Modify the default font color and input font color of input and select using js.
The default word color of textarea and the color of the word after the focus is obtained. After the focus is obtained, the default color disappears.
<Textarea cols = "50" rows = "5" id = "textarea" onfocus = "if (value = 'get element focal point') {value =''; document. getElementById ('textarea '). style. color = '# 000'} "onblur =" if (value = '') {value = 'element focus disappears'; document. getElementById ('textarea '). style. color = '# 000000'} "> enter the content you want to enter </textarea>
By default, the selected items in the select statement are in gray color and then black (implemented in js)
<script>var unSelected = "#999";var selected = "#333";$(function () {$("select").css("color", unSelected);$("option").css("color", selected);$("select").change(function () {var selItem = $(this).val();if (selItem == $(this).find('option:first').val()) {$(this).css("color", unSelected);} else {$(this).css("color", selected);}});})</script>
The input value has a default value and is gray. when clicked, the default value disappears and the input value turns black.
<Script type = "text/javascript"> $ (function () {// input $ (". form input [text] "). each (function () {$ (this ). setDefauleValue () ;}); // a single call $ ("# key "). setDefauleValue () ;}) // sets the default value $. fn. setDefauleValue = function () {var defauleValue = $ (this ). val (); values (this).val(defaulevalue}.css ("color", "# eee"); return this. each (function () {$ (this ). focus (function () {if ($ (this ). val () = defauleValue) {$ (this ). val ("" ).css ("color", "#000"); // the color of the input value }}). blur (function () {if ($ (this ). val () = "") {watermark (this(.val(defaulevalue0000.css ("color", "#999"); // The default color }});});} </script>