I have a class as
<div class="group-left article_left">
I need to add a id for this class dynamically using JavaScript.
i have added the following code
var thediv = document.getElementByClass("#group-left");
thediv.id = "pad_id";
But the id is not appearing in my code.Can anyone help me.
There is now getElementsByClass method in javascript unless you use some library. You can use jquery
You should only use one id per element though. Remember that