JS implementation text box input text page in the div layer synchronization to get text box content method _javascript Tips

Source: Internet
Author: User

The example of this article is about the method of obtaining the content of text box by the DIV layer in the Input text page of JS implementation text box. Share to everyone for your reference. The implementation methods are as follows:

Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> text box input text, page div layer sync get text box content </title>
<style>
textarea{width:300px;height:150px border:1px solid #CCC; font-size:12px; color: #000;}
p{padding-left:30px; text-indent:-30px;width:270px;height:250px; border:1px solid #900; margin-top:50px; font-size : 12px; Color: #F00; line-height:21px; Overflow:hidden}
</style>
<script type= "Text/javascript" >
function Swaptxt ()
{
var txt = document.getElementById ("EML"). Value;
document.getElementById ("Lyny"). Innerhtml=txt;
}
</script>
<body>
<textarea name= "" cols= "rows=" "class=" Loe_hk10 "id=" eml "onkeyup=" Swaptxt () "></textarea>
<p id= "Lyny" > Code home Hint: Please enter text in the text box above, such as www.jb51.net</p>
</body>

The

wants this article to help you with your JavaScript programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.