I would like to know how I could code this in jquery using chaining?
var table = document.getElementById("deliver_alt_table");
var rows = table.getElementsByTagName("tr");
$(rows[0].children[1]).css('visibility', 'hidden');
This code works - but how could it be written in jquery using one row?
$("#deliver_alt_table") // sorta like getElementById()
.find("tr") // sorta like getElementsByTagName()
.eq(0) // sorta like how you did rows[0]
.children() // sorta like rows[0].children
.eq(1) // sorta like rows[0].children[1]
.css('visibility', 'hidden');
Something like...
$("#deliver_alt_table tr:first > *:eq(1)").css("visibility", "hidden");
EDIT: Changed "nth-of-type" to "eq"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With