How to mimic jQquery's appendTo with a regular expression?
I use WordPress to manage a website and I’m currently (still… :) ) developing a theme. Now, I wrap some content in a div with a specific class to box it, but I want to append a
clear:both-div to that div in case there are any floating elements. I use jQuery as a temporary solution, like so:
I figure this can also be done with another way. Problem is, I have no clue how I’d go about something like this. Can I use any WordPress functions or would a regex be appropriate here?
I think it has to go something like this.
• Find all <div> start tags
• Look for the class name (e.g. ”
• Then append the
clear:both-div just before the corresponding
I hope someone can help.
This question is in the General Section. Responses must be helpful and on-topic.