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.
document.getElementsByClassName('group-left')[0]
? – James McLaughlin Feb 6 '12 at 15:46