Click Button – Swap Contents

[Total: 0    Average: 0/5]

This will swap textarea data between two boxes when you click on the button.

Head Code:

function switchem()
  var _form=document.ex1;
  var _object1=_form.t1;
  var _object2=_form.t2;
  var _temp=_object1.value;

Body Code:

<form name=ex1>
<textarea name=t1>ABC</textarea>
<input type=button value="Switch" onclick=switchem()>
<textarea name=t2>DEF</textarea>

Times Viewed: 9

Leave a Reply

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