Home  >  Article  >  Web Front-end  >  jquery constructor modifies data during form submission_jquery

jquery constructor modifies data during form submission_jquery

WBOY
WBOYOriginal
2016-05-16 15:57:54948browse

Post the code first

<script type="text/javascript">
  function appendText(){
    var content = $("#textarea").val();
    var new_content = content + "wap";
    $("#textarea").attr("value",new_content);
  };
</script>

Then when submitting the form

<form onsubmit="appendText();" >

Then check the data beauty in the background, and the corresponding characters will be added accordingly

The above is the entire content of this article, I hope you all like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn