在表格行中选择一个输入

时间:2018-09-06 08:54:20

标签: javascript jquery html select

div单击.mynote时如何显示类input的{​​{1}}元素?我尝试了以下代码,但不起作用。

id=title
$("#title").click(function() {
  $(".mynote").show();
});

2 个答案:

答案 0 :(得分:1)

  var arr =[]; //declared globally
    async function myloop(){

    for(i=0;i<10;i++){
    arr.push(i);
    }

    }

   // Here is what I wanna do now
    myloop().then(function(){
    for(i=10;i<20;i++){
    arr.push(i)
    }
    })

http://jsfiddle.net/7u0r8dvw/

答案 1 :(得分:0)

<table class="tall-table">
<tbody>
  <tr>
    <td class="tall-data">
      <div class="tall-note">
      <div class="mynote" style="display:none">
      some text here
      </div>
      </div>
    </td>
  </tr>
  <tr class="tall-data">
    <td class="tall-label">
      text ...
    </td>
  </tr>
  <tr>
    <td class="tall-data">
      <input name="title" id="title">
    </td>
  </tr>
  <tr class="tall-data">
    <td class="tall-label">
      text ...
    </td>
  </tr>
</tbody>
</table>
<script>
    $(document).ready(function(){
        $("#title").click(function() {
            $( ".mynote" ).show();
        });
    });
</script>