1. <!-- 内联事件 -->
    2. <button onclick="go()">btn</button>
    3. <script>
    4. function go(){
    5. console.log("hello world")
    6. }
    7. </script>
    1. /* 内联事件
    2. 定义 data-aid="123456"
    3. 获取自定义属性值 event.target.dataset.aid
    4. */
    5. function go(event){
    6. console.log("hello world");
    7. console.log(event.target.dataset.aid);
    8. }