20 January 2009

Membuat Teks Area dengan Highlight | Text Area with a highlight

There are variations from the text to make this area, that is, the text area by using the highlight. with the key highlight of this will make it easy for visitors to copy the entire text or code in a given, because with only one button press only highlighted earlier, the entire text or code that is in it will be the highlight and live in copy only. This facility is very useful when the text or code in the amount provided in the very many and this will reduce the risk cut a text or code to the copy. To create a text area with the highlight this you please copy the HTML code below :

<div> <form name="copy"> <div align="center"> <input onclick = "javascript: this.form.txt.focus (); this.form.txt . select (); "type =" button "value =" Highlight All "> </ div> <div align="center"> </ div> <p align =" center "> <textarea style="WIDTH: 300px; HEIGHT: 144px" name="txt" rows="100" wrap="VIRTUAL" cols="55"> save you any posts here , then the text you write will appear here and ready to copy by the visitors </ textarea> </ p> </ div> </ form>

So you better understand the code above, I will describe a few. Code on the part has two elements, namely elements of the code to create a button that reads Highlight All, and the second element is the code to make the text area.

All highlight the key elements:

1. <div align="center"> -> center said showed that the position will be key in the middle, so if you want to be in the position of the button to the left edge, living with change left. And if you want to be in the right edge, stay right to change the words.


2. <input onclick="javascript:this.form.txt.focus();this.form.txt.selec()"> -> this code means that when the key highlight at the click, the entire text of in it will be in highligt (or the mark in the block), so you do not change this article.


3. Value = "Highlight All" -> Highlight All the words are words that will appear in the key, so if you want to change this article, please replace the word you want.


Element text area:

1. <p align="center"> -> This text shows that the area will be located in the middle, if you want to see the text area you are in the left edge, replace the word center with left, if you want to the right edge, replace the words right.
2. <text style="WIDTH: 300px"> -> the word "width: 300px" width of the text shows the area as much as 300 pixels, so if you want to shorten or extend the width of the text area, you live it with a number you want. eg: "width: 700px;"


3. HEIGHT: 144px -> number "144px" text shows that the area will have a high of 144 px, so if you want to change lives to change the number with the number you want. Ex: HEIGHT: 160px.


Sample text of the key areas highlighted above, the load skript to protect the right click of the visitors. skript in this life if you do not want posts in your copy and paste the visitors. for interested please attach a copy ago in your HTML code between the code and <HEAD> </ HEAD> survivors try.

No comments:

Post a Comment