Possible Duplicate:
How to select first row of the first table in an html page using jQuery?
Suppose if I have multiple tables in my HTML page (without their ‘id’ attribute), so how can I select first row of the first table or any specific table using jQuery selectors? and after that i can highlight it using any color.Actually I want to do it by code behind. I had tried but my bad luck. My code is:
ScriptManager.RegisterStartupScript(
this,
this.GetType(),
"alert",
"<script language='javascript'>alert('hi');
$('table:tableOne').children('tr:first').css('background-color', '#ffdc87');
alert('end');</script>",
false);
As it showing there is any syntax error.
This will define a class “highlight” that has background yellow then select the first table of the first row and give it a class “highlight”.