点击后加1或减去1

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>点击后加1或减去1</title>
</head>
<body>
    <span id="num">0</span>
<button onclick="document.getElementById('num').innerHTML++">点击加1</button>


    <span id="num1">55</span>
    <button onclick="document.getElementById('num1').innerHTML--">点击减1</button>
</body>
</html>

效果图:

posted @ 2017-06-14 11:32  贺小鸣  阅读(197)  评论(0编辑  收藏  举报
为尊重他人劳动成果,转载/摘抄请标明来源!