<!DOCTYPE html> <html> <body> <input type="text" id="textbox1" value="10000223--DOMPARIDINE"> <input type="text" id="textbox2" value=""> <input type="text" id="textbox3" value=""> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var text1 = document.getElementById("textbox1").value; var result = text1.split("--"); document.getElementById("textbox2").value = result[0]; document.getElementById("textbox3").value = result[1]; } </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)