Td to the input of a double-click, all the input box on this row is assigned the same data

function setRowData (obj) {
     var .. len = $ (obj) .parent () parent () Find ( "INPUT" ) .length; // parent object that is located td, row i.e. the parent tr, and where to look All input block row
     var for inputValue = $ (obj) .val ();
     for ( var I = 0; I <len; I ++ ) {
        $(obj).parent().parent().find("input")[i].value=inputValue;
    } 
}

<tr align="center">
  <td class="table_none"> 

    <input id="input01" class="text_input50" value="0" type="text" ondblclick="setRowData(this);">

  </td>
  <td class="table_none">

    <input id="input01" class="text_input50" value="0" type="text" ondblclick="setRowData(this);">

  </td>

  <td class="table_none">

    <input id="input01" class="text_input50" value="0" type="text" ondblclick="setRowData(this);">

  </td>

</tr>

 

Guess you like

Origin www.cnblogs.com/liuna369-4369/p/12659917.html