Demo of Creating Array from a string

Here is the string used

Return to Array
Creating Array
Split function

( refresh this page to check again )

The code is here

<div id='a2' style=" background-color: #cccc33;" ></div>

<script type="text/javascript">
var str="this is my new tutorial";
document.getElementById("a2").innerHTML= str;
function create_array(){
var a1 = new Array();
a1=str.split(" ");
document.getElementById("a2").innerHTML= a1.join(" <br> ");
}
</script>
<br>
<input type=button value='Create Array' onClick='create_array()';>




plus2net.com




Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer