ล่าสุดการพัฒนาเว็บบทเรียน
×

JavaScript การอ้างอิง

ภาพรวม

JavaScript

JS เชือก JS จำนวน JS ผู้ประกอบการ JS งบ JS คณิตศาสตร์ JS วันที่ JS แถว JS บูลีน JS นิพจน์ทั่วไป JS สถานการณ์โดยรวม JS การแปลง

เบราว์เซอร์ BOM

Window Navigator Screen History Location

HTML DOM

DOM เอกสาร DOM องค์ประกอบ DOM แอตทริบิวต์ DOM เหตุการณ์ DOM รูปแบบ

HTML วัตถุ

<a> <abbr> <address> <area> <article> <aside> <audio> <b> <base> <bdo> <blockquote> <body> <br> <button> <canvas> <caption> <cite> <code> <col> <colgroup> <datalist> <dd> <del> <details> <dfn> <dialog> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <footer> <form> <head> <header> <h1> - <h6> <hr> <html> <i> <iframe> <img> <ins> <input> button <input> checkbox <input> color <input> date <input> datetime <input> datetime-local <input> email <input> file <input> hidden <input> image <input> month <input> number <input> password <input> radio <input> range <input> reset <input> search <input> submit <input> text <input> time <input> url <input> week <kbd> <keygen> <label> <legend> <li> <link> <map> <mark> <menu> <menuitem> <meta> <meter> <nav> <object> <ol> <optgroup> <option> <output> <p> <param> <pre> <progress> <q> <s> <samp> <script> <section> <select> <small> <source> <span> <strong> <style> <sub> <summary> <sup> <table> <td> <th> <tr> <textarea> <time> <title> <track> <u> <ul> <var> <video>

วัตถุอื่น ๆ

CSSStyleDeclaration


 

Input Color defaultValue Property

ป้อนข้อมูลอ้างอิงวัตถุสี การป้อนข้อมูลวัตถุสี

ตัวอย่าง

ได้รับค่าเริ่มต้นของตัวเลือกสี:

var x = document.getElementById("myColor").defaultValue

ผลของ x จะเป็น:

#ff0080

ลองตัวเอง»

ความหมายและการใช้งาน

ชุดคุณสมบัติ defaultValue หรือส่งกลับค่าเริ่มต้นของตัวเลือกสี

Note: ค่าเริ่มต้นคือค่าที่ระบุใน HTML ค่า แอตทริบิวต์

ความแตกต่างระหว่าง defaultValue และ ค่า สถานที่ให้บริการเป็นที่ defaultValue มีค่าเริ่มต้นในขณะที่มูลค่ามีมูลค่าปัจจุบันหลังจากการเปลี่ยนแปลงบางอย่างได้รับการทำ หากไม่มีการเปลี่ยนแปลง defaultValue และความคุ้มค่าเป็นเหมือนกัน (see "More Examples" below)

สถานที่ให้บริการ defaultValue เป็นประโยชน์เมื่อคุณต้องการที่จะหาไม่ว่าจะเป็นสีของตัวเลือกสีที่มีการเปลี่ยนแปลง


สนับสนุนเบราว์เซอร์

คุณสมบัติ
defaultValue ใช่ 10.0 ใช่ ใช่ ใช่

หมายเหตุ: <input type="color"> องค์ประกอบไม่แสดง ColorPicker ใด ๆ ใน Internet Explorer และ Safari


วากยสัมพันธ์

กลับ defaultValue ทรัพย์สิน:

colorObject .defaultValue

ตั้ง defaultValue ทรัพย์สิน:

colorObject .defaultValue= ค่าทรัพย์สิน
ความคุ้มค่า ลักษณะ
value ระบุค่าเริ่มต้นของตัวเลือกสี

รายละเอียดทางเทคนิค

กลับค่า: เชือกคิดเป็นค่าเริ่มต้นของตัวเลือกสี

ตัวอย่างอื่น ๆ

ตัวอย่าง

ตัวอย่างที่แสดงให้เห็นความแตกต่างระหว่าง defaultValue และทรัพย์สินมูลค่า:

var x = document.getElementById("myColor");
var defaultVal = x.defaultValue;
var currentVal = x.value;
ลองตัวเอง»

<input วัตถุสี