I'm learning JavaScript and I've got the question for you. The thing is that I am trying to wrap my head around some event operators, but in doing so, I came to know that there is something that I do not understand about nodes.
This is what works fine when I use jQuery:
var canvas = $ ('# cvs'); Canvas. Moussamov (function (e) {var page CRDS = '(' + E.P.xx + ', EGGI +' ')'; var B = document.gate elementBiID ("first"), B.Fest child.nodevalue = "(E. Paypex, E.P.A.G.) -" + Page CRD;});
but not working:
var canvas = document.getElementById ('cvs'); Canvas. Moussamov (function (e) {var page CRDS = '(' + E.P.xx + ', EGGI +' ')'; var B = document.gate elementBiID ("first"), B.Fest child.nodevalue = "(E. Paypex, E.P.A.G.) -" + Page CRD;});
The HTML I am using are both:
& lt; Canvas id = "cvs" width = "150" height = "150" & gt; & Lt; / Canvas & gt; & Lt; Div id = "before" & gt; Move the mouse to the canvas. & Lt; / Div & gt; & Lt; P id = "one" & gt; & Lt; / P & gt; & Lt; P id = "two" & gt; & Lt; / P & gt;
Can anyone shed some light, because jQuery-version works and not in pure JavaScript? Obviously, I would like to be able to do my work in javascript as well as javascript.
If you do not use JQuery, you can onmousemove
canvas.onmousemove = function (e) {var pageCrds = '(' + e.pageX + '). , '+ E.pageY +') '; Var b = document.getElementById ("first"); B.firstChild.nodeValue = "(e.pageX, e.pageY) -" + Page CRD; };
Comments
Post a Comment