Generalization

This page generalizes what we saw before.


Here, you are going to learn how to:


Add an img (or something else)

WSphynxJS works with all native HTML elements.

Add a new element

To add a new element in your HTML (like an img, em, pre ...), the name tag has to start with "ws":

<wsimg src="wsphynx.com/wsphynxjs/logo(1).png" > </wsimg> <wspre> Ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν· </wspre> <wstable> <wstr> <wsth>Ciceron</wsth> <wsth>Quousque tandem abutere, Catilina, patientia nostra?</wsth> </wstr> <wstr> <wstd>Caesar</wstd> <wstd>Alea jacta est.</wstd> </wstr> </wstable>

Add attributes to a WSphynxJS element

To add an attribute, you have to add "ws" at the beginning of every attribute name:

<wsdiv wsid="test"> Veni vedi vici <wsdiv>

Then, you can access the attributes with the usuals HTML DOM methods (here, wsid become id).

Copyright 2019 SphynxTech