This is where to start javascript

This is where to start your javascript code! Get this, run and move on. You can develop that as you want.

<script type = "text / javascript">
function getText (el) {
document.getElementById ('field'). value = el.innerHTML ;;
document.getElementById ('field2'). value = el.getAttribute ('index');
}

</script>
<input type = "text" id = "field" value = "sample value"> <br />
<input type = "text" id = "field2" value = "another sample value"> <br />
<a href = "javascript: void (0) "onclick =" getText (this) "index =" 1 "> text </a> <br />
<a href =" javascript: void (0) "onclick =" getText (this) "index =" 2 "> another text </a> <br />
<a href =" javascript: void (0) "onclick =" getText (this) "index =" 3 "> more text </a> <br />

These are 2 basic input fields. And also three links. Good for the start. Let’s develop that to create your application.

Leave a Reply

Your email address will not be published. Required fields are marked *