I need to add a div with class=row around a bunch of divs that are being dynamically created by a drupal module (cant do it in the view either)

i was trying this, but since it is created dynamically, it does not work:

$("#row").prepend("<div id='edit-secondary-wrapper'/>");

this is the div that the module spits out that i want a row around

  • Which module is used to create those elements dynamically? May 13, 2015 at 15:41
  • shs drupal module May 13, 2015 at 16:19
  • Are you using it with views as an exposed filter?
    – No Sssweat
    May 13, 2015 at 16:21
  • I did not set up the view, I am the designer trying to make it look good :) here is a screenshot of the view set up: suzetteballew.com/bogart/ss.png May 13, 2015 at 16:29

1 Answer 1


You may be looking for this

$("#edit-secondary-wrapper").wrap("<div class='row'></div>");

This wraps the div with id 'edit-secondary-wrapper' with a parent div with class 'row'.

  • row = $('<div />').addClass('row'); $('#edit-secondary-wrapper').wrap(row) would be cleaner even :)
    – Beebee
    Jun 16, 2015 at 10:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.