Jhtml is a fast JavaScript library designed to bring quick reactivity to HTML sites
- Download the latest version of Jhtml from Here or link it directly through HTML
- Inside the head tag include
<script src="./jhtml.js"></script>Or<script src="https://guyotjs.github.io/Jhtml/build/jhtml.js"></script>
⭐ Congratulations Jhtml is in your project
- At the bottom of the body tag make a new
<script></script>tag - Inside the script tag make a new function called react. (Must include return 0;)
function react(){
return 0;
}- Now your project is able to react.
<p id="text"></p>- Create a new variable for the text content
let val = "This text will change" - Inside the
react()function add a new line before the return - The content func will take 2 arguments the id and the text
content("text", val);- Inside the script tag create a new function for the button click event
let val = "This text will change"
function react(){
content("text", val);
return 0;
}- Create a button in the body tag
<button onclick="click()"></button>- Now create a new function for the button click event.
function click(){} - Inside the click function all you have to do is include
val = "The text changed"
Final Code
<button onclick="click"></button>
<p id="text"></p>
<script>
let val = "This text will change"
function react(){
content("text", val);
return 0;
}
</script>⭐ Congratulations you made your first reactive project
Tutorial is a work in progress more stuff in the works.