Skip to content

Tag: html

How to calculate percentage in this JQuery

I have a problem in jQuery in html. Just need some changes in calculation, below are my codes All result will be calculated in one field as I did Existing: total = expenses – socso – kwsp The result i need is: total = expenses – socso – (kwsp / 100 * expenses) Thank you Answer As you c…

Increment array up to max items

I’ve written this code. It rotates two divs like a card flip using css transform every 1000ms and displays new text in the div, which is drawn from an array. It runs infinitely. But once the array reaches its end I get an ‘undefined’ value because the i++ is incrementing on the final array i…

How to change an svg image after onClick()?

I have a div tab that contains some text and an svg icon like so Once I click that tab then it expands like so Once expanded I want the svg icon to change to something else. So far my code isn’t throwing me any errors but also isn’t working as expected either. I currently have a function that shou…