点击事件获得li标签内容

通过点击事件获得li标签内容


Table of contents

随笔

<li onclick="liClick(this)">数据</li>
//点击会显示'数据'

<script>
function liClick(data){
    console.log($(data).text());
}
</script>

猜你喜欢

转载自www.cnblogs.com/selton/p/9183463.html
今日推荐