Yeak Yeak - 1 year ago 157
HTML Question

jquery find all hidden input fields with specific class name

I have a couple of table rows and tables with hidden input fields and values. What i need to do is loop through all the hidden input fields and find a specific field where the class = 'something' and value = something and go up to the

of that input field and change the background color.

if( $(this).find(".id_schedule_hours") && $(this).val() == 1) {

Answer Source

.each() is not necessary; you can use attributes selector, .closest()

.closest("td").css("backgroundColor", /* color */)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download