JavaScript: Where do I Find All Properties for All HTML Elements ? JavaScript: ฉันจะหาคุณสมบัติทั้งหมดสำหรับทุกองค์ประกอบ HTML ที่ไหน
Posted on 08. โพสต์ใน 08. Jun, 2009 by Dragos in Coding , JavaScript & Ajax มิ.ย., 2,009 โดย Dragos ใน การเข้ารหัส, JavaScript และ Ajax
You think you're good at JavaScript? คุณคิดว่าคุณเก่ง JavaScript? Ok. ตกลง. Here's a question that'll test your JavaScript wisdom: How many properties does a DIV element have? นี่เป็นคำถามที่จะทดสอบปัญญา JavaScript ของคุณ: วิธีคุณสมบัติหลายองค์ประกอบ div ไม่ได้?
Your answer is 5? คำตอบของคุณ 5? Because there is the name, id, class, style or title property. เนื่องจากมี ชื่อ id, ชั้นสไตล์ หรือทรัพย์สิน title. Maybe your answer is a little bit more than 5, but would you be surprised if I told you that there are more than 60 properties for the div element (62 in total, I think)? อาจเป็นคำตอบของคุณหน่อยมากกว่า 5 แต่จะคุณจะประหลาดใจถ้าฉันบอกคุณว่ามีกว่า 60 คุณสมบัติสำหรับองค์ประกอบ div (62 ในทั้งหมดผมคิด) Don't worry, me too I was surprised when I found out about it. อย่ากังวลฉันเกินไปฉันรู้สึกประหลาดใจเมื่อพบเกี่ยวกับ. And all these properties are there to help you better interact with your element and with the client. และคุณสมบัติทั้งหมดเหล่านี้มีเพื่อช่วยให้คุณดีขึ้นโต้ตอบกับองค์ประกอบและกับลูกค้าของคุณ.
Here's a list of div properties: นี่รายการของคุณสมบัติ div ของ:
I was talking about the div element, but the other elements do also have dozens of properties that you might never heard of before. ฉันถูกพูดถึงองค์ประกอบ div แต่องค์ประกอบอื่นๆยังมีนับสิบคุณสมบัติที่คุณอาจไม่เคยได้ยินมาก่อน. Find all properties for the elements you're interested in at Java2s.com . พบคุณสมบัติทั้งหมดสำหรับองค์ประกอบที่คุณสนใจที่ Java2s.com. Good luck discovering the new possibilities of JavaScript! โชคดีพบความเป็นไปได้ใหม่ของ JavaScript!
Related posts: บทความที่เกี่ยวข้อง:
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: วิธีการรับดัชนี (ตำแหน่งภายในกลุ่ม) ของวัตถุด้วย jQuery?
- JavaScript: Get anchor from URL JavaScript: Get ทอดสมอจาก URL
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: ส่งหน้าที่เป็นพารามิเตอร์ทำงาน (callbacks อื่น)
- Javascript: How to validate email address with JavaScript? Javascript: การตรวจสอบที่อยู่อีเมลด้วย JavaScript?
- PHP: Get all files and folders from a directory (folder) PHP: ดูไฟล์และโฟลเดอร์ทั้งหมดจาก directory (โฟลเดอร์)













































