كائن مصدر DOM HTML
كائن المصدر
يمثل الكائن المصدر عنصر HTML <source>.
الوصول إلى كائن مصدر
يمكنك الوصول إلى عنصر <source> باستخدام getElementById ():
مثال
var x = document.getElementById("mySource");
قم بإنشاء كائن مصدر
يمكنك إنشاء عنصر <source> باستخدام طريقة document.createElement ():
مثال
var x = document.createElement("SOURCE");
خصائص كائن المصدر
Property | Description |
---|---|
media | Sets or returns the value of the media attribute in a <source> element |
src | Sets or returns the value of the src attribute in a <source> element |
type | Sets or returns the value of the type attribute in a <source> element |
الخصائص القياسية والأحداث
يدعم كائن المصدر أيضًا الخصائص والأحداث القياسية .
الصفحات ذات الصلة
دروس HTML: فيديو HTML5
دروس HTML: صوت HTML5
مرجع HTML: علامة HTML <source>