Home > Web Front-end > JS Tutorial > body text

jquery constructor modifies data during form submission_jquery

WBOY
Release: 2016-05-16 15:57:54
Original
950 people have browsed it

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>
Copy after login

Then when submitting the form

<form onsubmit="appendText();" >

Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!