JavaScript:HTML DOM در جاوااسکریپت
نسخهای که میبینید نسخهای قدیمی از صفحهاست که توسط Admin (بحث | مشارکتها) در تاریخ ۲۵ آبان ۱۳۹۸، ساعت ۰۰:۴۴ ویرایش شده است. این نسخه ممکن است تفاوتهای عمدهای با نسخهٔ فعلی بدارد. |
ظظظظظظظظظظظظظظظظظظظظ [۱]
محتویات
JavaScript HTML DOM
Html dom در جاوا اسکریپت
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
با html dom ، جاوا اسکریپت می تواند به عناصر یک سند html دسترسی پیدا کند و تمامی آن عناصر را تغییر دهد.
The HTML DOM (Document Object Model)
Html dom یا document object model
When a web page is loaded, the browser creates a Document Object Model of the page.
زمانی که یک صفحه وب بارگذاری می شود ، مرورگر یک document object model از صفحه می سازد.
The HTML DOM model is constructed as a tree of Objects:
مدل html dom از درختی از اشیا تشکیل شده است :
The HTML DOM Tree of Objects
درخت اشیای html dom
With the object model, JavaScript gets all the power it needs to create dynamic HTML:
با مدل شی یا object model ، جاوا اسکریپت قدرت لازمه را برای ساخت یک صفحه html پویا بدست می آورد :
· JavaScript can change all the HTML elements in the page
جاوا اسکریپت می تواند تمامی عناصر html در یک صفحه را تغییر بدهد .
· JavaScript can change all the HTML attributes in the page
جاوا اسکریپت می تواند تمامی خواص یا Attribute ها را در یک صفحه تغییر دهد.
· JavaScript can change all the CSS styles in the page
جاوا اسکریپت می تواند تمامی استایل های Css در یک صفحه را تغییر دهد.
· JavaScript can remove existing HTML elements and attributes
جاوا اسکریپت می تواند یک عنصر html را به همراه خواص یا Attribute هایش حذف کند.
· JavaScript can add new HTML elements and attributes
جاوا اسکریپت می تواند عناصر جدید html و خواص یا attribute های جدید اضافه کند.
· JavaScript can react to all existing HTML events in the page
جاوا اسکریپت می تواند با تمامی رویداد های موجود در یک صفحه html واکنش داشته باشد.
· JavaScript can create new HTML events in the page
جاوا اسکریپت می تواند رویداد های جدید html در یک صفحه ایجاد کند.
What You Will Learn
چه چیزی شما یاد خواهید گرفت
In the next chapters of this tutorial you will learn:
در فصل های آینده این آموزش شما موارد زیر را خواهید آموخت :
· How to change the content of HTML elements
چگونه محتوای عناصر html را تغییر دهیم
· How to change the style (CSS) of HTML elements
چگونه استایل (css) یک عنصر html را تغییر دهیم.
· How to react to HTML DOM events
چگونه می توان به رویداد های html doc واکنش نشان داد
· How to add and delete HTML elements
چگونه عناصر html را اضافه و حذف کنیم؟
What is the DOM?
Dom چیست ؟
The DOM is a W3C (World Wide Web Consortium) standard.
Dom یک w3c یا استاندارد کنسرسیوم جهانی وب گسترده است .
The DOM defines a standard for accessing documents:
Dom یک استاندارد برای دسترسی به سند ها تعریف می کند :
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
"dom یا w3c Document Object Model یک پلتفرم و یک رابط مستقل از زبان است که اجازه می دهد برنامه ها و اسکریپت ها به صورت پویا به ساختار و استایل یک سند دسترسی داشته باشند و محتوای آن را بروز کنند ."
The W3C DOM standard is separated into 3 different parts:
استاندارد w3c dom به سه بخش مختلف تقسیم می شود :
· Core DOM - standard model for all document types
هسته dom یا Core dom – مدل استاندارد برای هر تمامی نوع های سند
· XML DOM - standard model for XML documents
Xml dom – مدل استاندارد برای سند های xml
· HTML DOM - standard model for HTML documents
Html dom – مدل استاندارد برای سند های html
What is the HTML DOM?
Html dom چیست ؟
The HTML DOM is a standard object model and programming interface for HTML. It defines:
Html dom یک مدل object استاندارد و یک رابط برنامه نویسی برای htmlاست . این مدل موارد زیر را تعریف می کند :
· The HTML elements as objects
عناصرhtml ، اشیاء هستند .
· The properties of all HTML elements
تمامی ویژگی های تمام عناصر html
· The methods to access all HTML elements
متد هایی برای دسترسی به تمام عناصر html
· The events for all HTML elements
رویداد هایی برای تمام عناصر html
In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements.
به عبارتی دیگر : html dom یک استاندارد برای نحوه دریافت ، تغییر ، اضافه کردن و یا حذف عناصر html است .
منابع آموزشی