I have following code to change the style of an element, once I enter the page the alert window will be shown with "myP" message; whoever, the style wont get added to the element. Also, let me know if you have jQuery based solution for it.
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
alert("myP");
document.getElementById("myP").style.fontWeight = "bold";
</script>
...
<a id="myP" href="www.example.com">Example</a>
...
</body>
</html>