javascript - Input text not selectable -
I have a problem with jQuery. I'm working on a table with every & lt; Td>
inside & lt; Input & gt; I use it to focus through
is tab key columns:
var i = 0; $ ('# Pl_table tr') Each (function () {$ (this). Find ('td'). (Function (i) {$ (this). Find ('input'). Attr ('tabindex' , I + 1);});});
My problem If I use this code then it is not possible to select input values from table input. Do not even use and Shift + arrows with the mouse.
The table row looks like this:
& lt; Tr class = 'tripRow nopair' id = '1' & gt; & Lt; Td square = 'drop' & gt; & Lt; / Td> & Lt; Td id = 'col1' class = 'check' & gt; & Lt; Input name = 'tripRow1 []' type = 'checkbox' name = 'monkey' value = 'marked' / & gt; & Lt; / TD & gt; & Lt; Td id = 'col2' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' size = '2' / & gt; & Lt; / TD & gt; & Lt; Td id = 'col3' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' maximum length = '10' size = '10 'readable / & gt; & Lt; / TD & gt; & Lt; Td id = 'col4' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' maximum length = '6' size = '4' /> & Lt; / TD & gt; & Lt; Td id = 'col5' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' maxlength = '1' size = '1' / & gt; & Lt; / TD & gt; & Lt; Td id = 'col6' class = 'center' & gt; & Lt; Input class = 'sending' name = 'tripRow1 []' type = 'text' value = '' / / gt; & Lt; / TD & gt; & Lt; Td id = 'col7' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' / / gt; & Lt; / TD & gt; & Lt; Td id = 'col8' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' maximum length = '3' size = '3' /> & Lt; / TD & gt; & Lt; Td id = 'col9' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' type = 'text' value = '' maxlength = '10 'size =' 10 '/> & Lt; / TD & gt; & Lt; Td id = 'col10' square = 'center' & gt; & Lt; Input name = 'tripRow1 []' class = 'time movie' type = 'text' value = '' maximum length = '8' size = '8' /> & Lt; / TD & gt; & Lt; Td id = 'col11' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' class = 'time movie' type = 'text' value = '' maximum length = '8' size = '8' /> & Lt; / TD & gt; & Lt; Td id = 'col12' class = 'center' & gt; & Lt; Input name = 'tripRow1 []' class = 'time movie' type = 'text' value = '' maximum length = '8' size = '8' /> & Lt; / TD & gt; & Lt; / TR & gt;
I have one of these & lt; Td> I only know how to read
s but I have a problem with others. I am using IE10.
Any suggestions? Thank you very much for your help.
If I did not go wrong, then you need a few code like this, down order,
$ (function () {var tdLength = $ ("# pl_table tr: first td"). Length; var k = 0; var i = 0; i & lt; tdLength; i ++) {$ ('# pl_table tr'). Each (function () {$ (this). Find ('td: eq (' + i + 'input' ') Attr (' tabindex ', k ++)});}});
Comments
Post a Comment