Carl Topham

jQuery + Firebug = reduced repetitive work

Have you ever had a page that needed styles applying to certain elements again and again (and again) in some sort of pattern. The finished page could have no js either. I just had a long page of tables that the 3rd column had to be formatted differently and it was a pain so I needed a way around the problem. Write a quick bit of jQuery to apply to to the page and preview it in the browser. Then using firebug (firefox plugin), cmd/right click the document root element and click “copy HTML”. Just paste that into a new file and you now have the static HTML which the jQuery applied the styles to. Just remember to delete the jQuery code from the new doc and you are done.This example adds the class “value” to all the third “td” elements in the document: $(document).ready(function() { var str = ":nth-child(3n)"; $("tr td" + str).addClass('value');         });Resources:http://api.jquery.com/nth-child-selector/http://stackoverflow.com/questions/2184862/saving-the-manipulated-dom-html-after-editing-it-with-firebug

Category: Web development

Comments

yourtrader20 f

Nov. 13, 2011, 4:53 a.m.

The Latest Trading Software for Sale! All Software In The List (More Than 6000 Titles Or 40 Dvds)!Just For 300$! Our online store:http://tradersdvd.co.cc Our Blog:www.wininvest.cz.cc For additional questions send to us a message:yourtrader3000@gmail.com;yourtrader2008@gmail.com;yourtrader2006@yahoo.com The Latest Trading Software for Sale! All Software In The List (More Than 6000 Titles Or 40 Dvds)!Just For 300$! Our online store:http://tradersdvd.co.cc For additional questions send to us a message:yourtrader3000@gmail.com;yourtrader2008@gmail.com;yourtrader2008@gmail.com! Visit our online store <a href=http://tradersdvd.co.cc>Golden Traders' Software Collection</a>.

carpinteyrolls

May 2, 2012, 10 a.m.

Flowers reside in memory of victims one's tourist boat "Bulgaria", which sank in Volga river, at the key harbour of Kazan July 11, 2011.   <br /><br /><br/>MOSCOW - A standard of 122 bodies folks victims killed in Volga ship tragedy have been located, local regional emergencies side branch told Itar-Tass on Later. <br />"As of also, the death of 122 people is something that is officially registered, " a spokesman simply department was quoted as saying. <br />The 65-year-old Getaway cruise boat carrying 201 a person who sank in Volga patterns are released July 10. Only 79 of the company's passengers were rescued. <a href=http://www.stodiosbeats.com/>Beats Headphones</a> <br />.

Add A comment