Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <form action="#">
  2. <textarea class="input" name="input" type="text" id="txt" />test</textarea>
  3. <input type="button" value="Run" id="run"/>
  4. </form>
  5.  
  6. $(document).ready(function() {
  7. $('#run').click(function() {
  8. var textarea=$('#txt');
  9. textarea.html(textarea.html().replace(/test/g,"ok"));
  10. });
  11. });
  12.  
  13. $('#run').click(function() {
  14. var textarea=$('#txt');
  15. textarea.val(textarea.val().replace(/test/g,"ok"));
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement