Link to home
Start Free TrialLog in
Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on

Html split(text)

Hi experts, I wish to read the text inside input and write it on innerHTML separately by way of slash "/" that the result would something like below. Is this possible? Please help.

Whing
Delacruz
88
22

<!DOCTYPE html>
<html>
<body>

<input type="text" id="ii" value="Whing/Delacruz/88/22">
<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var str = document.getElementById("ii").value;
    var res = str.split...
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whing Dela Cruz

ASKER

Thank you so much sir, its working!