I added if-else & loops in HTML5

So it’s time to stop the meme that HTML is not a programming language. i just added support to HTML5 of for loops
if else conditions.
template inclusions.
automatic State rebuild on variable change.
lot’s of things nowadays they have in bloatwares like…


This content originally appeared on DEV Community and was authored by somen das

So it's time to stop the meme that HTML is not a programming language. i just added support to HTML5 of for loops
if else conditions.
template inclusions.
automatic State rebuild on variable change.
lot's of things nowadays they have in bloatwares like react.

check it out on guthub under KTBsomen/httl-s
To use this library, simply include the script in your HTML file after the body tag this should be loaded at last after defining all custom components:

    <script src="https://cdn.jsdelivr.net/gh/KTBsomen/httl-s@main/statejs.js"></script>
<for-loop array="[1, 2, 3]" valueVar="item" indexVar="index" loopid="loop1">
    <template loopid="loop1">
        <p>Index: ${index}, Value: ${item}</p>
    </template>
</for-loop>
<condition-block ifid="condition1">
    <if-condition value="5" eq="5" elseid="conditionElse">
        <p>Condition is true!</p>
    </if-condition>
    <else-condition elseid="conditionElse">
        <p>Condition is false!</p>
    </else-condition>
</condition-block>


This content originally appeared on DEV Community and was authored by somen das


Print Share Comment Cite Upload Translate Updates
APA

somen das | Sciencx (2025-06-07T03:38:31+00:00) I added if-else & loops in HTML5. Retrieved from https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/

MLA
" » I added if-else & loops in HTML5." somen das | Sciencx - Saturday June 7, 2025, https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/
HARVARD
somen das | Sciencx Saturday June 7, 2025 » I added if-else & loops in HTML5., viewed ,<https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/>
VANCOUVER
somen das | Sciencx - » I added if-else & loops in HTML5. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/
CHICAGO
" » I added if-else & loops in HTML5." somen das | Sciencx - Accessed . https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/
IEEE
" » I added if-else & loops in HTML5." somen das | Sciencx [Online]. Available: https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/. [Accessed: ]
rf:citation
» I added if-else & loops in HTML5 | somen das | Sciencx | https://www.scien.cx/2025/06/07/i-added-if-else-loops-in-html5/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.