方法一:
直接用找到對應dom元素調用.click()方法
$('.user_content').click(function(){ $(this).children()[0].click(); //Dom元素執行點擊事件
//或者Dom元素執行點擊事件
$(this).children('input[type="radio"]')[0].click();
}
方法二:
參考:https://blog.csdn.net/qq_37000055/article/details/101562653
html
<div class="tempStyle" @click="checked($event)"> <input class="hy-radio" type="radio" name="a"><label>選項1</label> </div> <div class="tempStyle" @click="checked($event)"> <input class="hy-radio" type="radio" name="a"><label>選項2</label> </div>
對應js
method: {
checked(e) {e.currentTarget.firstElementChild.click();}
}