You can use javascripts document.getElementById().style method to alter CSS values. Here’s an example:
Create your div tag:
Now create your javascript function:
function changeCss()
{
document.getElementById("myDiv").style.border = '2px dotted #CCC';
}
Now you can call this javascript function on any given event to alter your CSS tags border. Things like height, width, and a bunch others work as well. For instance create an html button, and onclick call the changeCss() function.
No related posts.