jQuery获取button上的值

前端代码如下:

<div class="Tag-removable btn-group" role="group" aria-label="..."> <button id="" type="button" class="btn btn-success btn-xs">{{$v.Tag_name}}</button> <button type="button" class="btn btn-success remove btn-xs"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> </button> </div>

获取第一个button元素上的值:

$("div.Tag-removable").find("button:first-child").text();

$("div.Tag-removable").find("button").get(0).text();

$("div.Tag-removable").find("button").first().text();
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务