ElementById?
<HTML> <HEAD> <TITLE>test</TITLE> <script src="prototype.js"></script> <script> function test1() { $('idtest2').innerHTML = $('idtest1').innerHTML; } function test2() { $('idtest3').innerHTML = $F('testText'); } </script> </HEAD> <BODY> <div id="idtest1"> </div> <div id="idtest2"> </div> <div id="idtest3"> </div> <input type="button" value=Test1 onclick="test1();"><br> <input type="button" id="testButton" value=Test2 onclick="test2();"><br> </BODY> </HTML>
JavaScript http://braincast.nl/samples/jsoneditor/
<script type="text/javascript"><!-- function getData() { var dataObject = {"data": [ ] }; $('target').innerHTML = dataObject.data[0].test1; var target2data = ""; for(var intfor=0; intfor < dataObject.data.length; intfor++) { target2data += dataObject.data[intfor].test1 + dataObject.data[intfor].test2 + "<br>"; } $('target2').innerHTML = target2data; var tbody = $('resulttb'); for(var intfor=tbody.rows.length-1; intfor >=0 ; intfor--) { var tr=tbody.deleteRow(intfor); } for(var intfor=0; intfor < dataObject.data.length; intfor++) { var tr=tbody.insertRow(intfor); tr.insertCell(0).innerHTML = dataObject.data[intfor].test1; tr.insertCell(1).innerHTML = dataObject.data[intfor].test2; } } //--> </script> <table> <thead> <tr> <th> test1 </th> <th> test2 </th> </tr> </thead> <tbody id="result"> </tbody> </table>
Welcome to Y System Creat Web Site !
dhtmlgoodies
function copyArray(fromArray){ var newArray = new Array; var prop; for(prop in fromArray) { newArray[prop]=fromArray[prop]; } return newArray; }
The Yahoo! User Interface Library (YUI)
Taffy DB : A JavaScript database
JavaScript
simpleCart
JavaScript