Thursday, 27 February 2020

Selecting different elements in Jquery

For selecting an id field with name mytable we can use

$('#mytable')

we can also use

$('.mytable')
If you want to select a row in my table use $('.mytable.tr') if you have to select h1 which is inside a paragraphwhich is  inside a div $('div.myDiv p h1') To get first row of table $('#myTable tbody tr:first') To select every text box and paragraph $('p,input') Change background of first row $('#meetable tbody tr:first').css('background-color','blue')

No comments:

Post a Comment