Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  37] [ 7]  / answers: 1 / hits: 24942  / 12 Years ago, thu, december 13, 2012, 12:00:00

VB script statement ,



Set oHighlightedRow = document.all(SearchRow & nHighlightedRow)
oHighlightedRow.cells(0).focus()



These two statments need to be converted to javascript.anyone can help me to find a solution?
Thanx



My converted code was,



var oHighlightedRow = $(#SearchRow + nHighlightedRow);
oHighlightedRow.cells[0].focus();


Is this correct ?


More From » jquery

 Answers
12

OK:



var oHighlightedRow = document.all(SearchRow + nHighlightedRow);
oHighlightedRow.cells[0].focus();


Or, better (assuming the row has an id of SearchRow + nHighlightedRow):



var oHighlightedRow = document.getElementById(SearchRow + nHighlightedRow);
oHighlightedRow.cells[0].focus();


Or, jQuery (again assuming the row has an id of SearchRow + nHighlightedRow):



$(#SearchRow + nHighlightedRow +  td:first).focus();

[#81445] Wednesday, December 12, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
katelynn

Total Points: 378
Total Questions: 86
Total Answers: 108

Location: Azerbaijan
Member since Fri, May 12, 2023
1 Year ago
;