Events

This page introduces WSphynxJS events


Here, you are going to learn how to:


Add an event for a specific div

Event tags let you interact with your HTML code. To add an event tag, it is necessary to understand what a wsdiv is.

Event tag

The event tag is composed of "ws"+"on"+theNameOfTheEvent:

<wsdiv wsid="test"> Qui scribit bis legit <wsonmousedown> element.textContent = "Clic"; </wsonmousedown> <wsonmouseup> element.textContent = "Up"; </wsonmouseup> <wsonmousedown> console.log ("Clic"); </wsonmousedown> <wsonmousedown> console.log ("Up"); </wsonmousedown> </wsdiv>

NOTE: you can code in pure JS inside an event. See the Scripts chapter for more information.

Copyright 2019 SphynxTech