Question

Anyone help me how to set the id for a div class dynamically in code. Let suppose class name by group_left

      <div class-"group_left article_left">

I have to add a id attribute for this class "group_left article left"

I have used the java script to set the id but I can't.This is my code.

   var thediv = document.getElementByClassName(".group-left ");
    thediv.setAttribute("id", "pad_id");

There is any way API to add attribute id for a class in drupal.please help me.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top