The js ontouchstart event is invalid. The page must be refreshed to be valid.

var _canvase=document.getElementsByTagName("canvas")[0]
_canvase.ontouchstart = function(e) {        
    _canvase.ontouchstart = function(e) {    
    console.log("55559")
};
Mar.04,2021

there's nothing wrong with it, but why do you write it twice?

    <div style="border:1px solid -sharpccc;">
        <canvas style="width:100px;height:100px;"></canvas>
    </div>

    <script>
        var ctx = document.getElementsByTagName("canvas")[0];
        ctx.ontouchstart = function(e){
            console.log('33333333');
        }
    </script>
Menu