<?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>document object Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/document-object/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/document-object/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:30:46 +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>How many create cookies in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-many-create-cookies-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-many-create-cookies-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Sat, 14 Aug 2021 12:39:32 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[document object]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[property]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7946</guid>

					<description><![CDATA[<p>JavaScript Cookies Cookies are exposed as the cookie property of the Document object. This property is both readable and writeable. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-many-create-cookies-in-javascript/">How many create cookies in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading"><strong>JavaScript Cookies</strong></h1>



<p class="wp-block-paragraph">Cookies are exposed as the cookie property of the Document object. This property is both readable and writeable.</p>



<p class="wp-block-paragraph">You can see Cookies in Google Chrome by following chrome://settings/content/cookies</p>



<h1 class="wp-block-heading"><strong>Creating Cookies</strong></h1>



<p class="wp-block-paragraph">When you assign a string to document.cookie, the browser parses it as a cookie and adds it to its list of cookies. There are several parts to each cookies, many of them optional.</p>



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



<p class="wp-block-paragraph" id="block-0bbc4906-32da-4254-a4a7-5076d7e5c92b">document.cookie = “name=value”;<br>document.cookie = “name=value; expires=date; domain=domain; path=path; secure”;<br>document.cookie = “name=value; max-age=inSecond; domain=domain; path=path; secure”;</p>



<h2 class="wp-block-heading">Ex:-</h2>



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



<h1 class="wp-block-heading"><strong>Creating Cookies</strong></h1>



<p class="wp-block-paragraph"><strong>Optional Cookies Attribute:-</strong></p>



<p class="wp-block-paragraph">max-age<br>expires<br>domain<br>path<br>secure</p>



<p class="wp-block-paragraph">Whenever you omit the optional cookie fields, the browser fills them in automatically with reasonable defaults.</p>



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



<p class="wp-block-paragraph">It is used to create persistent cookies. It is supported by all modern browsers except IE.</p>



<p class="wp-block-paragraph"><strong>Type of cookies: &#8211;</strong></p>



<ul class="wp-block-list"><li>Session Cookies – Cookies that are set without the expires/max-age field are called session cookies. It is destroyed when the user quits the browser.</li><li>Persistent Cookies – The browser keeps it up until their expiration date is reached.</li></ul>



<h2 class="wp-block-heading">Ex:-</h2>



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



<h1 class="wp-block-heading"><strong>expires</strong></h1>



<p class="wp-block-paragraph">It is used to create persistent cookies.</p>



<h3 class="wp-block-heading">Type of cookies: &#8211;</h3>



<ul class="wp-block-list"><li>Session Cookies – Cookies that are set without the expires/max-age field are called session cookies. It is destroyed when the user quits the browser.</li><li>Persistent Cookies – The browser keeps it up until their expiration date is reached.</li></ul>



<p class="wp-block-paragraph">E<strong>x:-</strong></p>



<p class="wp-block-paragraph">document.cookie = “username=devops; expires=Monday, 3-Sep-2018 09:00:00 UTC”;</p>



<h1 class="wp-block-heading"><strong>domain</strong></h1>



<p class="wp-block-paragraph">It specifies the domain for which the cookie is valid. If not specified, this defaults to the host portion of the current document location. If a domain is specified, subdomains are always included.</p>



<p class="wp-block-paragraph"><strong>Ex: &#8211;</strong></p>



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



<h1 class="wp-block-heading"><strong>path</strong></h1>



<p class="wp-block-paragraph">Path can be / (root) or /mydir (directory). If not specified, defaults to the current path of the current document location, as well as its descendants.</p>



<p class="wp-block-paragraph"><strong>Ex: &#8211; document.cookie = “username=devops; path=/”;</strong></p>



<p class="wp-block-paragraph"><strong>Ex: &#8211; document.cookie = “username=devops; path=/home”;</strong></p>



<h1 class="wp-block-heading"><strong>secure</strong></h1>



<p class="wp-block-paragraph">Cookie to only be transmitted over secure protocol as https. Before Chrome 52, this flag could appear with cookies from http domains.</p>



<p class="wp-block-paragraph"><strong>Ex: &#8211; document.cookie = “username=devops; secure”;</strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-many-create-cookies-in-javascript/">How many create cookies 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-many-create-cookies-in-javascript/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>What is the use of the document object model in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/what-is-the-use-of-the-document-object-model-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-is-the-use-of-the-document-object-model-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 11:48:02 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[document object]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[Node Relationship]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7483</guid>

					<description><![CDATA[<p>Document Object Model The Document Object Model (DOM) is an Application Programming Interface (API) for HTML and XML documents. With [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-use-of-the-document-object-model-in-javascript/">What is the use of the document object model 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>Document Object Model</strong></h2>



<ul class="wp-block-list"><li>The Document Object Model (DOM) is an Application Programming Interface (API) for HTML and XML documents.</li><li>With the Document Object Model, programmers can create and build documents, navigate their structure, and add, modify, or delete elements and content.</li><li>The DOM is an object-oriented representation of the web page, which can be modified with a scripting language such as JavaScript.</li><li>The DOM model represents a document with a logical tree.</li><li>According to Document Object Model (DOM), every HTML-tag is an object. Nested tags are called “children” of the enclosing one. All operations on the DOM start with the document object. From it, we can access any node.</li><li>The Document Object Model can be used with any programming language.</li></ul>



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



<ul class="wp-block-list"><li>DOM Level 0 – This level supports the common document object collections – form[ ], image[ ], anchors[ ], links[ ] and applets[ ]. This is also known as classic or traditional JavaScript Object Model. • </li></ul>



<ul class="wp-block-list"><li>DOM Level 1- It provides the ability to manipulate all elements in a document through a common set of functions. In this level, all elements are exposed and parts of the page can be read and written to at all times. </li></ul>



<ul class="wp-block-list"><li> DOM Level 2 – It provides further access to page elements primarily related to CSS and focuses on combining Level 0 and Level 1 while adding improved support for working with XML documents.</li></ul>



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



<ul class="wp-block-list"><li>DOM Level 3 – Enhanced Level of Level 1 and Level 2 and added support for XPath and keyboard event handling.</li></ul>



<ul class="wp-block-list"><li>DOM Level 4 – Enhanced  year 2015</li></ul>



<h2 class="wp-block-heading"><strong>Categories of DOM</strong></h2>



<ul class="wp-block-list"><li>DOM Core – It specifies a generic model for viewing and manipulating a marked-up document as a tree structure.</li></ul>



<ul class="wp-block-list"><li>DOM HTML – It specifies an extension to the core DOM for use with HTML. This represents DOM Level 0 with capabilities for manipulating all of the HTML element objects.</li></ul>



<ul class="wp-block-list"><li>DOM CSS – It specifies the interfaces necessary to manipulate CSS rules programmatically.</li></ul>



<ul class="wp-block-list"><li>DOM Events – It adds event handling to the DOM.</li></ul>



<ul class="wp-block-list"><li>DOM XML – It specifies an extension to the Core Dom for use with XML.</li></ul>



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



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="600" height="300" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree.png" alt="" class="wp-image-7485" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree-300x150.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" width="558" height="348" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree-code.png" alt="" class="wp-image-7486" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree-code.png 558w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/document-tree-code-300x187.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></figure>



<h2 class="wp-block-heading"><strong>DOM Node Types</strong></h2>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Constant</strong></td><td class="has-text-align-center" data-align="center"><strong>Node Type</strong></td><td><strong>Description</strong></td></tr><tr><td>Node.ELEMENT_NODE</td><td class="has-text-align-center" data-align="center">1</td><td>An element such as &lt;h1> or &lt;div></td></tr><tr><td>Node.TEXT_NODE</td><td class="has-text-align-center" data-align="center">3</td><td>The actual Text of Element or Attribute ex: &#8211; “Hello”</td></tr><tr><td>Node.PROCESSING_INSTRUCTION_NODE</td><td class="has-text-align-center" data-align="center">7</td><td>An instruction to a parser on aspect of the document &lt;?xml version=“1.0”?></td></tr><tr><td>Node.COMMENT_NODE</td><td class="has-text-align-center" data-align="center">8</td><td>A comment such as &lt; &#8211; &#8211; Something &#8211; &#8211; ></td></tr><tr><td>Node.DOCUMENT_NODE</td><td class="has-text-align-center" data-align="center">9</td><td>A Document Node</td></tr><tr><td>Node.DOCUMENT_TYPE_NODE</td><td class="has-text-align-center" data-align="center">10</td><td>A doctype statement &lt;!DOCTYPE html></td></tr><tr><td>Node.DOCUMENT_FRAGMENT_NODE</td><td class="has-text-align-center" data-align="center">11</td><td>A document fragment, which represents a lightweight structure to hold a collection of DOM nodes for manipulation or insertion.</td></tr></tbody></table></figure>



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



<ul class="wp-block-list"><li><strong>Parent</strong></li><li><strong>Children</strong></li><li><strong>First Child</strong></li><li><strong>Previous Sibling</strong></li><li><strong>Next Sibling</strong></li><li><strong>Last child</strong></li></ul>



<h2 class="wp-block-heading"><strong>DOM Node 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><strong>Description</strong></td></tr><tr><td class="has-text-align-center" data-align="center">nodeName</td><td>Contains the name of the node</td></tr><tr><td class="has-text-align-center" data-align="center">nodeValue</td><td>Contains the value within the node; generally only applicable to text nodes</td></tr><tr><td class="has-text-align-center" data-align="center">nodeType</td><td>Holds a number corresponding to the type of node</td></tr><tr><td class="has-text-align-center" data-align="center">parentNode</td><td>Reference to the parent node of the element, if one exists</td></tr><tr><td class="has-text-align-center" data-align="center">childNodes</td><td>Access to the list of child nodes</td></tr><tr><td class="has-text-align-center" data-align="center">firstChild</td><td>Reference to the first child node of the element, if one exists</td></tr><tr><td class="has-text-align-center" data-align="center">lastChild</td><td>Points to the last child node of the element, if one exists</td></tr><tr><td class="has-text-align-center" data-align="center">previousSibling</td><td>Reference to the previous sibling of the node; for example, if its parent node has multiple children</td></tr><tr><td class="has-text-align-center" data-align="center">nextSibling</td><td>Reference to the next sibling of the node; for example, if its parent node has multiple children</td></tr><tr><td class="has-text-align-center" data-align="center">attributes</td><td>The list of the attributes for the element</td></tr><tr><td class="has-text-align-center" data-align="center">ownerDocument</td><td>Points to the HTML Document object in which the element is contained</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-the-use-of-the-document-object-model-in-javascript/">What is the use of the document object model 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/what-is-the-use-of-the-document-object-model-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
