请原因,首先这不是重复我无法解决这个问题我在尝试阅读带有“e”属性的textarea时未定义
function naa(e) {
var postida = $(e).attr('id');
var comment = $("#not_" + postida).val(); //returns undefined textarea value
alert(postida); //returns correct id value
alert(comment); //returns undefined texarea value
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea class="form-control comment jj" id="not_<?php echo $ch_file ?>" title="fileId" rows="3"></textarea>
<button class="btn btn-warning btn-lg btn-block wnana" id="fileId" onclick="naa(this)" style="margin-top:10px;">Add comment</button>
<!--run naa function when thr btn is clicked
I also tried
var comment = $("#not_"+postida).text(); //returns undefined textarea value too
-->
答案 0 :(得分:0)
试试这个......
react-native-cli: 0.1.10
react-native: 0.42.0