<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DOM Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/dom/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/dom/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 21 Feb 2026 07:13:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>DOM Deep Dive: Architecture, Use Cases, Workflow, and Practical Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/dom-deep-dive-architecture-use-cases-workflow-and-practical-guide/</link>
					<comments>https://www.scmgalaxy.com/tutorials/dom-deep-dive-architecture-use-cases-workflow-and-practical-guide/#respond</comments>
		
		<dc:creator><![CDATA[Vijay K]]></dc:creator>
		<pubDate>Thu, 29 May 2025 08:29:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[BrowserAPI]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[EventHandling]]></category>
		<category><![CDATA[Frontend]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[WebComponents]]></category>
		<category><![CDATA[WebDevelopment]]></category>
		<category><![CDATA[WebTech]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=12446</guid>

					<description><![CDATA[<p>1. What is the DOM? The Document Object Model (DOM) is a standardized programming interface that represents web documents (HTML, [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/dom-deep-dive-architecture-use-cases-workflow-and-practical-guide/">DOM Deep Dive: Architecture, Use Cases, Workflow, and Practical Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="576" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-118-1024x576.png" alt="" class="wp-image-12456" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-118-1024x576.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-118-300x169.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-118-768x432.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-118.png 1400w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">1. What is the DOM?</h2>



<p class="wp-block-paragraph">The <strong>Document Object Model (DOM)</strong> is a standardized programming interface that represents web documents (HTML, XML) as a hierarchical tree of objects, allowing programs and scripts to dynamically access, manipulate, and update the content, structure, and style of documents.</p>



<p class="wp-block-paragraph">Originally developed by the World Wide Web Consortium (W3C) and refined by the WHATWG, the DOM serves as a bridge between web content and scripting languages like JavaScript. When a browser loads a web page, it parses the HTML markup into a DOM tree, turning elements, attributes, and text into objects that can be accessed and modified through APIs.</p>



<p class="wp-block-paragraph">The DOM&#8217;s key purpose is to enable interactive and dynamic web applications, allowing developers to programmatically alter the content and appearance of web pages in response to user actions, network events, or time-based triggers.</p>



<h3 class="wp-block-heading">Historical Context</h3>



<ul class="wp-block-list">
<li>The concept originated in the mid-1990s alongside the rise of dynamic webpages.</li>



<li>Early DOM implementations varied between browsers, leading to compatibility issues.</li>



<li>The W3C standardized the DOM to create uniformity.</li>



<li>Modern browsers have largely converged on this standard, with incremental extensions and performance improvements.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">2. Major Use Cases of the DOM</h2>



<h3 class="wp-block-heading">2.1 Dynamic Content Updates</h3>



<p class="wp-block-paragraph">One of the primary uses of the DOM is updating webpage content dynamically. For example, modifying text, images, or entire sections without reloading the page. This underpins interactive behaviors such as live search suggestions, content filters, and updating data visualizations.</p>



<h3 class="wp-block-heading">2.2 Event-Driven Programming</h3>



<p class="wp-block-paragraph">The DOM provides an event system that allows capturing and responding to user interactions like clicks, key presses, form submissions, mouse movements, and more. This capability is foundational for interactive web apps.</p>



<h3 class="wp-block-heading">2.3 Form Validation and User Input Handling</h3>



<p class="wp-block-paragraph">By accessing form elements and their values via the DOM, developers can perform client-side validation, provide instant feedback, or enhance forms with dynamic fields.</p>



<h3 class="wp-block-heading">2.4 Animations and Visual Effects</h3>



<p class="wp-block-paragraph">The DOM API allows scripts to change CSS properties in real-time, enabling animations, transitions, and dynamic styling changes that improve user experience and engagement.</p>



<h3 class="wp-block-heading">2.5 AJAX and Partial Page Updates</h3>



<p class="wp-block-paragraph">Using the DOM in conjunction with AJAX techniques, web apps can fetch data asynchronously and update parts of the page dynamically without full reloads, resulting in smoother, faster interfaces.</p>



<h3 class="wp-block-heading">2.6 Building Complex UI Frameworks and Libraries</h3>



<p class="wp-block-paragraph">Popular JavaScript frameworks (React, Vue, Angular) abstract the DOM by introducing concepts like the virtual DOM to efficiently manage and update user interfaces at scale.</p>



<h3 class="wp-block-heading">2.7 Accessibility Features</h3>



<p class="wp-block-paragraph">Through the DOM, developers can ensure proper semantic markup, ARIA attributes, and interactive behaviors that assistive technologies use to provide accessibility for users with disabilities.</p>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">3. How the DOM Works Along with Architecture</h2>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="641" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-117-1024x641.png" alt="" class="wp-image-12455" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-117-1024x641.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-117-300x188.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-117-768x481.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-117.png 1042w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">3.1 DOM as a Tree of Nodes</h3>



<p class="wp-block-paragraph">At its core, the DOM models a document as a <strong>tree structure</strong> composed of various types of nodes:</p>



<ul class="wp-block-list">
<li><strong>Document Node:</strong> The root node representing the entire document.</li>



<li><strong>Element Nodes:</strong> Represent HTML elements such as <code>&lt;div&gt;</code>, <code>&lt;p&gt;</code>, <code>&lt;a&gt;</code>.</li>



<li><strong>Attribute Nodes:</strong> Describe attributes of elements like <code>class</code>, <code>id</code>.</li>



<li><strong>Text Nodes:</strong> Contain the actual textual content inside elements.</li>



<li><strong>Comment Nodes:</strong> Represent HTML comments.</li>



<li><strong>DocumentFragment Nodes:</strong> Lightweight containers used for batch operations.</li>
</ul>



<p class="wp-block-paragraph">Each node is an object exposing properties and methods to traverse and manipulate the tree, forming parent-child and sibling relationships.</p>



<h3 class="wp-block-heading">3.2 Layers of the DOM Architecture</h3>



<p class="wp-block-paragraph">The DOM architecture can be conceptually divided into:</p>



<ul class="wp-block-list">
<li><strong>DOM Core:</strong> Defines the fundamental interfaces and structures for any document type.</li>



<li><strong>DOM HTML:</strong> Extends DOM Core with interfaces specific to HTML documents.</li>



<li><strong>DOM Events:</strong> Defines event models including capturing, bubbling, and event propagation.</li>



<li><strong>DOM Style:</strong> Provides access to CSS styles and computed style information.</li>
</ul>



<h3 class="wp-block-heading">3.3 Browser Parsing and Rendering Pipeline</h3>



<ul class="wp-block-list">
<li>The browser receives HTML from the server.</li>



<li><strong>HTML Parser</strong> converts the markup into the DOM tree.</li>



<li>CSS is parsed into the <strong>CSS Object Model (CSSOM)</strong>.</li>



<li>The DOM and CSSOM are combined into the <strong>Render Tree</strong>, which determines what is displayed.</li>



<li>Layout and painting are performed based on the render tree.</li>



<li>JavaScript interacts with the DOM, potentially modifying it and triggering reflows and repaints as necessary.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">4. Basic Workflow of DOM Manipulation</h2>



<h3 class="wp-block-heading">4.1 Accessing Elements</h3>



<p class="wp-block-paragraph">You can locate nodes within the DOM tree using various APIs:</p>



<ul class="wp-block-list">
<li><code>getElementById(id)</code> — finds element with the specified id.</li>



<li><code>getElementsByClassName(className)</code> — returns elements with a class.</li>



<li><code>getElementsByTagName(tagName)</code> — retrieves elements by tag name.</li>



<li><code>querySelector(selector)</code> / <code>querySelectorAll(selector)</code> — modern, flexible selectors.</li>
</ul>



<h3 class="wp-block-heading">4.2 Reading and Modifying Content</h3>



<ul class="wp-block-list">
<li><code>innerHTML</code> and <code>textContent</code> read or set HTML/text inside elements.</li>



<li>Attributes can be read or modified using <code>getAttribute()</code> and <code>setAttribute()</code>.</li>
</ul>



<h3 class="wp-block-heading">4.3 Creating and Adding Elements</h3>



<ul class="wp-block-list">
<li><code>document.createElement(tagName)</code> creates new nodes.</li>



<li>Nodes are inserted using methods like <code>appendChild()</code>, <code>insertBefore()</code>, or modern <code>append()</code>.</li>
</ul>



<h3 class="wp-block-heading">4.4 Event Handling</h3>



<ul class="wp-block-list">
<li>Attach event listeners with <code>addEventListener(eventType, handler, options)</code>.</li>



<li>Events propagate through <strong>capturing</strong> and <strong>bubbling</strong> phases.</li>



<li>Event delegation optimizes handling by attaching listeners to parent elements.</li>
</ul>



<h3 class="wp-block-heading">4.5 Removing or Replacing Nodes</h3>



<ul class="wp-block-list">
<li>Nodes can be removed via <code>removeChild()</code> or directly with <code>element.remove()</code>.</li>



<li>Replace nodes using <code>replaceChild()</code>.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">5. Step-by-Step Getting Started Guide for DOM</h2>



<h3 class="wp-block-heading">Step 1: Access a DOM Element</h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;p id=&quot;demo&quot;&amp;gt;Hello World&amp;lt;/p&amp;gt;

&amp;lt;script&amp;gt;
  const p = document.getElementById(&#039;demo&#039;);
  console.log(p.textContent);  // Outputs: Hello World
&amp;lt;/script&amp;gt;

</pre></div>


<h3 class="wp-block-heading">Step 2: Change Element Content and Style</h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
p.textContent = &quot;DOM Manipulation is fun!&quot;;
p.style.color = &quot;green&quot;;

</pre></div>


<h3 class="wp-block-heading">Step 3: Create and Insert New Elements</h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
const newDiv = document.createElement(&#039;div&#039;);
newDiv.textContent = &quot;New Div Element&quot;;
document.body.appendChild(newDiv);

</pre></div>


<h3 class="wp-block-heading">Step 4: Add Event Listener to Element</h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
newDiv.addEventListener(&#039;click&#039;, () =&amp;gt; {
  alert(&#039;Div clicked!&#039;);
});

</pre></div>


<h3 class="wp-block-heading">Step 5: Remove an Element</h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
newDiv.remove();

</pre></div>


<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">6. Advanced DOM Concepts</h2>



<h3 class="wp-block-heading">6.1 Event Propagation</h3>



<ul class="wp-block-list">
<li><strong>Capturing phase:</strong> Event trickles down from the root to the target.</li>



<li><strong>Target phase:</strong> Event reaches the target.</li>



<li><strong>Bubbling phase:</strong> Event bubbles up from target to root.</li>
</ul>



<p class="wp-block-paragraph">Understanding this is key for effective event handling strategies.</p>



<h3 class="wp-block-heading">6.2 Mutation Observers</h3>



<p class="wp-block-paragraph">Used for watching changes in the DOM without inefficient polling. Useful in frameworks and plugins to react to DOM modifications.</p>



<h3 class="wp-block-heading">6.3 Shadow DOM and Web Components</h3>



<p class="wp-block-paragraph">Shadow DOM provides encapsulation by isolating part of the DOM subtree and CSS from the main document, enabling reusable custom components.</p>



<h3 class="wp-block-heading">6.4 Performance Optimization</h3>



<ul class="wp-block-list">
<li>Batch DOM updates to minimize layout thrashing.</li>



<li>Use <code>DocumentFragment</code> for multiple insertions.</li>



<li>Avoid excessive reflows and repaints.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading">7. Summary</h2>



<p class="wp-block-paragraph">The Document Object Model is fundamental to modern web development, serving as the backbone that enables dynamic, interactive, and rich web experiences. Mastery of the DOM — from tree structure, event handling, and manipulation APIs to advanced concepts like shadow DOM and mutation observers — equips developers to create responsive, accessible, and performant applications.</p>



<p class="wp-block-paragraph">The ability to control and react to changes within the DOM is what transforms static webpages into dynamic web apps that respond seamlessly to user input and real-time data.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/dom-deep-dive-architecture-use-cases-workflow-and-practical-guide/">DOM Deep Dive: Architecture, Use Cases, Workflow, and Practical Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/dom-deep-dive-architecture-use-cases-workflow-and-practical-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use Traversing DOM Elements using jQuery?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-traversing-dom-elements-using-jquery/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-traversing-dom-elements-using-jquery/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Mon, 27 Sep 2021 12:37:26 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[index.html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[main.js]]></category>
		<category><![CDATA[style.css]]></category>
		<category><![CDATA[traversing]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=9253</guid>

					<description><![CDATA[<p>So in this blog, we’re going to learn that How to use Traversing DOM Elements using jQuery? So let’s go [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-traversing-dom-elements-using-jquery/">How to use Traversing DOM Elements using jQuery?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So in this blog, we’re going to learn that How to use <strong>Traversing DOM Elements </strong>using <strong>jQuery</strong>?</p>



<p class="wp-block-paragraph">So let’s go ahead and do that for first in&nbsp;<strong>index.html</strong>, with help of&nbsp;<strong>style.css</strong>&nbsp;&amp;&nbsp;<strong>main.js</strong>.</p>



<script src="https://gist.github.com/ajcotocus/8e7d6a7993b2c55114b26a6c9be78a94.js"></script>



<script src="https://gist.github.com/ajcotocus/45aa989440c79f318d53ed94f0c4f79a.js"></script>



<script src="https://gist.github.com/ajcotocus/b89dfa0290020579c4f3b17781928dc1.js"></script>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="589" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108-1024x589.png" alt="" class="wp-image-9258" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108-1024x589.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108-300x173.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108-768x442.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108-1536x884.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/image-108.png 1608w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Traversing&nbsp;DOM&nbsp;Elements&nbsp;using&nbsp;jQuery</figcaption></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-traversing-dom-elements-using-jquery/">How to use Traversing DOM Elements using jQuery?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-traversing-dom-elements-using-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use Form Handling in javascript</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-use-form-handling-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-use-form-handling-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 13 Aug 2021 12:08:53 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[document object]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[Form Handling]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[properties]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7922</guid>

					<description><![CDATA[<p>Form Handling JavaScript provides access to the forms within an HTML document through the Form object known as HTMLFormElement in [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-form-handling-in-javascript/">How to use Form Handling in javascript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><strong>Form Handling</strong></h2>



<p class="wp-block-paragraph">JavaScript provides access to the forms within an HTML document through the Form object known as HTMLFormElement in the DOM. Which is a child of the Document Object.</p>



<h2 class="wp-block-heading"><strong>Properties</strong></h2>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>Properties</strong></td><td class="has-text-align-center" data-align="center"><strong>Value</strong></td><td><strong>Description</strong></td></tr><tr><td class="has-text-align-center" data-align="center">accept-charset</td><td class="has-text-align-center" data-align="center">UTF-8</td><td>Specifies the charset used in the submitted form (default: the page charset).</td></tr><tr><td class="has-text-align-center" data-align="center">action</td><td class="has-text-align-center" data-align="center">URL</td><td>Contains a URL that defines where to send the data after submitting the form</td></tr><tr><td class="has-text-align-center" data-align="center">autocomplete</td><td class="has-text-align-center" data-align="center">On (default)<br>Off</td><td>Determines that the browser retains the history of previous values.</td></tr><tr><td class="has-text-align-center" data-align="center">enctype</td><td class="has-text-align-center" data-align="center"></td><td>specifies how the browser encodes the data before it sends it to the server. (default: is url-encoded).</td></tr><tr><td class="has-text-align-center" data-align="center">encoding</td><td class="has-text-align-center" data-align="center"></td><td>Holds the value of the enctype attribute, which usually contains either application/x-www-form-urlencoded value or the multipart/form-data value (in the case of file upload)</td></tr><tr><td class="has-text-align-center" data-align="center">elements[ ]</td><td class="has-text-align-center" data-align="center"></td><td>An array of DOM elements that correspond to the interactive form fields within the form</td></tr></tbody></table></figure>



<h2 class="wp-block-heading"><strong>Properties</strong></h2>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>Properties</strong></td><td class="has-text-align-center" data-align="center"><strong>Value</strong></td><td><strong>Description</strong></td></tr><tr><td class="has-text-align-center" data-align="center">length</td><td class="has-text-align-center" data-align="center"></td><td>The number of a form field with a given form tag. Should bt the same as elements.length</td></tr><tr><td class="has-text-align-center" data-align="center">method</td><td class="has-text-align-center" data-align="center">GET (default)<br>POST</td><td>Specifies how to send the form data to a web server. The data can be sent as URL variables, by using the get method or as HTTP post, by using the post method</td></tr><tr><td class="has-text-align-center" data-align="center">name</td><td class="has-text-align-center" data-align="center">name</td><td>Specifies a name used to identify the form</td></tr><tr><td class="has-text-align-center" data-align="center">novalidate</td><td class="has-text-align-center" data-align="center">novalidate</td><td>Specifies that the browser should not validate the form.</td></tr><tr><td class="has-text-align-center" data-align="center">target</td><td class="has-text-align-center" data-align="center">_self (default)<br>_blank<br>_parent<br>_top<br>framename</td><td>Specifies the target of the address in the action attribute</td></tr></tbody></table></figure>



<h2 class="wp-block-heading"><strong>Methods</strong></h2>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>Method</strong></td><td><strong>Description</strong></td></tr><tr><td class="has-text-align-center" data-align="center">checkValidity ( )</td><td>Returns a true or false value indicating whether or not all the fields in the form are in a valid state.</td></tr><tr><td class="has-text-align-center" data-align="center">reset ( )</td><td>Returns all form fields to their initial state.</td></tr><tr><td class="has-text-align-center" data-align="center">submit ( )</td><td>Submits the form to the URL specified in the form’s action attribute</td></tr></tbody></table></figure>



<h3 class="wp-block-heading"><strong>Events: &#8211;</strong></h3>



<ul class="wp-block-list"><li>onreset</li><li>onsubmit</li></ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-form-handling-in-javascript/">How to use Form Handling in javascript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-use-form-handling-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>HTML-DOM and CSS-DOM Mapping in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/html-dom-and-css-dom-mapping-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/html-dom-and-css-dom-mapping-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 10 Aug 2021 10:52:47 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mapping]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7740</guid>

					<description><![CDATA[<p>HTML-DOM Mapping Many object properties are simply direct mapping to the attributes of the HTML element. In other words, there [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/html-dom-and-css-dom-mapping-in-javascript/">HTML-DOM and CSS-DOM Mapping in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">HTML-DOM Mapping</h2>



<p class="wp-block-paragraph">Many object properties are simply direct mapping to the attributes of the HTML element. In other words, there is a mapping directly between HTML Syntax and the DOM.</p>



<p class="wp-block-paragraph">Ex:-</p>



<script src="https://gist.github.com/vijaypk376/ad5574dd627f52e057709b417ebf35f4.js"></script>



<p class="wp-block-paragraph">Above title can be accessed in DOM by<br>document.getElementById(“myid”).title</p>



<p class="wp-block-paragraph">P tag’s title attribute is mapped to DOM property title in the above example that is the reason we can access title in DOM that way.</p>



<h2 class="wp-block-heading">HTML-DOM Mapping</h2>



<p class="wp-block-paragraph">The mapping is direct between HTML attributes and the DOM properties with the following considerations:-</p>



<ul class="wp-block-list"><li><strong>The mapping is direct if the attribute is a single non-reserved word, so an element’s title attribute is accessed via the corresponding DOM object’s title property. </strong></li><li><strong>The mapping will change case as camelCase if the attribute has two word.   Ex:- tabindex attribute will be represented tabIndex in the DOM. </strong></li><li><strong>If the HTML attribute name is reserved under JavaScript, the value will be modified to work. </strong> Ex:- class attribute will be represented className in DOM for attribute will be represented htmlFor in DOM </li><li><strong>There are also some exception.</strong>  Ex: &#8211; char attribute will be represented ch in DOM </li><li><strong>For others and custom attributes, we have to use getAttribute() and setAttribute( ) Methods because they may not have direct mapping.</strong></li></ul>



<h2 class="wp-block-heading"><strong>CSS-DOM Mapping</strong></h2>



<p class="wp-block-paragraph">We can modify the CSS Properties by applying a mapping between the CSS property and the DOM object. The mapping is direct between CSS properties and the DOM properties with the following considerations:-</p>



<ul class="wp-block-list"><li><strong>CSS properties have a single word, so their mapping is direct. </strong>           Ex:- <em>color</em> in CSS will be represented as <em>color</em> in DOM too. </li><li><strong>Hyphenated CSS properties are repsrented as a single word with camelCase in the DOM. </strong>        Ex:- <em>background-color</em> in CSS will be represented as <em>backgroundColor</em> in DOM </li><li><strong>CSS properties value with vendor prefixs. </strong> Ex:- <em>-webkit-box-shadow</em> in CSS will be represented as <em>webkitBoxShadow</em> in DOM.</li><li><strong>There are some reserved words which can be exception in the above cases.</strong>    Ex &#8211; <em>float</em> in CSS will be represented as <em>cssFloat</em> in DOM</li></ul>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/html-dom-and-css-dom-mapping-in-javascript/">HTML-DOM and CSS-DOM Mapping in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/html-dom-and-css-dom-mapping-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
