{"id":1557,"date":"2020-10-09T20:34:09","date_gmt":"2020-10-09T17:04:09","guid":{"rendered":"https:\/\/behnudi.ir\/?p=1557"},"modified":"2024-09-04T11:06:18","modified_gmt":"2024-09-04T07:36:18","slug":"js02-syntax","status":"publish","type":"post","link":"https:\/\/behnudi.ir\/?p=1557","title":{"rendered":"\u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a: \u06f2- \u0633\u06cc\u0646\u062a\u064e\u06a9\u0633"},"content":{"rendered":"<h3>\u062f\u0633\u062a\u0648\u0631 \u0632\u0628\u0627\u0646 &#8211; Syntax<\/h3>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u062d\u0633\u0627\u0633 \u0628\u0647 \u0646\u0648\u0639 \u062d\u0631\u0641 (Case Sensitive)<\/strong>:<br \/>\n\u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0647 \u06a9\u0648\u0686\u06a9\u06cc \u06cc\u0627 \u0628\u0632\u0631\u06af\u06cc \u062d\u0631\u0648\u0641 \u0627\u0647\u0645\u06cc\u062a \u0645\u06cc\u200c\u062f\u0647\u062f \u0648 \u0622\u0646\u0647\u0627 \u0631\u0627 \u062f\u0648 \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631 \u0645\u062a\u0641\u0627\u0648\u062a \u062f\u0631 \u0646\u0638\u0631 \u0645\u06cc \u06af\u06cc\u0631\u062f. (A \u2260 a)<\/li>\n<li><strong>\u0628\u06cc \u062a\u0641\u0627\u0648\u062a \u0646\u0633\u0628\u062a \u0628\u0647 \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627<\/strong>:<br \/>\n\u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627 \u0631\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f. \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627\u060c \u0633\u0631 \u062e\u0637 \u0631\u0641\u062a\u0646 \u0648 \u062a\u0648\u0631\u0641\u062a\u06af\u06cc\u200c\u0647\u0627 \u0647\u0645\u0647 \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u0627\u06cc\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0631\u0639\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f.<\/li>\n<li><strong>\u062a\u0648\u0636\u06cc\u062d\u0627\u062a (Comments)<\/strong>:<br \/>\n\u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0631\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u0648\u0644\u06cc \u0628\u0631\u0627\u06cc \u0641\u0647\u0645\u06cc\u062f\u0646 \u0631\u0648\u0646\u062f \u0627\u062c\u0631\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0628\u0633\u06cc\u0627\u0631 \u0636\u0631\u0648\u0631\u06cc \u0627\u0633\u062a. \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0628\u0647 \u062f\u0648 \u0631\u0648\u0634 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062f\u0631 \u0645\u062a\u0646 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0646\u0648\u0634\u062a\u0647 \u0634\u0648\u062f.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"js\">\r\n\/\/ Single line Comments\r\n\r\n\/*\r\nMulti-line\r\nComments\r\n*\/\r\n\r\n<\/code><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u0633\u0650\u0645\u06cc \u06a9\u064f\u0644\u064f\u0646 (Semicolon)<\/strong>:<br \/>\n\u0633\u0645\u06cc \u06a9\u0644\u0646 \u0646\u0634\u0627\u0646 \u062f\u0647\u0646\u062f\u0647 \u067e\u0627\u06cc\u0627\u0646 \u062f\u0633\u062a\u0648\u0631 \u0627\u0633\u062a.<br \/>\n\u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0686\u0646\u062f \u062f\u0633\u062a\u0648\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u062f\u0631 \u06cc\u06a9 \u062e\u0637 \u067e\u0634\u062a \u0633\u0631 \u0647\u0645 \u0628\u06cc\u0627\u06cc\u062f.<br \/>\n\u0648 \u06cc\u0627 \u06cc\u06a9 \u062f\u0633\u062a\u0648\u0631 \u062f\u0631 \u0686\u0646\u062f \u062e\u0637 \u0632\u06cc\u0631 \u0647\u0645 \u0646\u0648\u0634\u062a\u0647 \u0634\u0648\u062f.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"js\">\r\nMultiple Statements; On One Line;\r\n\r\nOne Statement \r\nOn Multiple Lines;\r\n\r\n<\/code><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u0646\u0642\u0637\u0647 (Dot)<\/strong>:<br \/>\n\u0628\u06cc\u0646 \u0646\u0627\u0645 \u0622\u0628\u062c\u06a9\u062a \u0648 \u067e\u0631\u0627\u067e\u0631\u062a\u06cc\u060c \u0645\u062a\u062f \u06cc\u0627 \u0627\u06cc\u0648\u0646\u062a \u0647\u0645\u06cc\u0634\u0647 \u0646\u0642\u0637\u0647 \u06af\u0630\u0627\u0634\u062a\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"js\">\r\nObject.property\r\nObject.method\r\nObject.event\r\n\r\n<\/code><\/pre>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1021.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h3>\u0622\u063a\u0627\u0632 \u06a9\u0627\u0631 \u062f\u0631 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/h3>\n<p>\u067e\u06cc\u0634 \u0627\u0632 \u0647\u0631 \u06a9\u0627\u0631\u06cc \u0628\u0647\u062a\u0631 \u0627\u0633\u062a \u0628\u0627 \u0686\u0646\u062f \u0622\u0628\u062c\u06a9\u062a \u062f\u0631 \u0648\u0628 \u0628\u0631\u0648\u0632\u0631 \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u0645.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-689\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/get-started.jpg\" \/><\/p>\n<h4>window<\/h4>\n<p>\u0622\u0628\u062c\u06a9\u062a window\u060c \u0622\u0628\u062c\u06a9\u062a \u06af\u0644\u0648\u0628\u0627\u0644 (global) \u06cc\u0627 \u0633\u0631\u0627\u0633\u0631\u06cc \u0646\u0627\u0645\u06cc\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0639\u0646\u0627 \u06a9\u0647 \u067e\u0631\u0627\u067e\u0631\u062a\u06cc \u0648 \u0645\u062a\u062f\u0647\u0627\u06cc \u0622\u0646 \u0647\u0645\u0647 \u062c\u0627 \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0627\u0633\u062a. \u0648 \u0646\u06cc\u0627\u0632\u06cc \u0628\u0647 \u0646\u0648\u0634\u062a\u0646 \u0622\u0646 \u0646\u06cc\u0633\u062a.<\/p>\n<h4>window.alert<\/h4>\n<p>\u0645\u062a\u062f alert \u06cc\u06a9 \u067e\u06cc\u0627\u0645 \u0631\u0627 \u062f\u0631 \u06cc\u06a9 \u067e\u0646\u062c\u0631\u0647 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<pre><code class=\"js\">\r\n\/\/ Displaying a text message\r\nwindow.alert(\"Hello World!\");\r\n\r\n\/\/ is the same as\r\nalert(\"Hello World!\");\r\n\r\n\/\/ Displaying a Number \r\nalert(20); \/\/ Outputs: 20\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-690\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/alert.png\" \/><\/p>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1022.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h4>\u062a\u0645\u0631\u06cc\u0646 \u06f1<\/h4>\n<ul>\n<li>\u062f\u0631 \u0641\u0648\u0644\u062f\u0631 js1 \u06cc\u06a9 \u0641\u0648\u0644\u062f\u0631 \u0628\u0647 \u0646\u0627\u0645 1-02 \u0628\u0633\u0627\u0632\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u0628\u0647 \u0646\u0627\u0645 index.html \u062f\u0631 \u0622\u0646 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u0646\u062a\u0631\u0646\u0627\u0644 \u062f\u0631 \u0622\u0646 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u067e\u06cc\u0627\u0645 \u0632\u06cc\u0631 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f:\n<div class=\"ltr tac\">I&#8217;m &#8216;<mark>Name<\/mark>&#8216;, Can I help you?<\/div>\n<\/li>\n<li>\u0628\u062c\u0627\u06cc Name \u0646\u0627\u0645 \u062e\u0648\u062f \u0631\u0627 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-691\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/02-1.png\" \/><\/p>\n<h4>console<\/h4>\n<p>\u0622\u0628\u062c\u06a9\u062a console \u0628\u06cc\u0634\u062a\u0631 \u0628\u0631\u0627\u06cc \u0627\u0634\u06a9\u0627\u0644 \u0632\u062f\u0627\u06cc\u06cc (debugging) \u0627\u0633\u062a. \u0648 \u062e\u0637\u0627\u0647\u0627 \u0622\u0646\u062c\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<h4>console.log<\/h4>\n<p>\u0645\u062a\u062f console.log \u06cc\u06a9 \u067e\u06cc\u0627\u0645 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<pre><code class=\"js\">\r\n\/\/ Displaying a text\r\nconsole.log(\"Hello World!\");\r\n\r\n\/\/ Displaying a Number \r\nconsole.log(20); \/\/ Outputs: 20\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-692\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/console.png\" \/><\/p>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1023.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h4>\u062a\u0645\u0631\u06cc\u0646 \u06f2<\/h4>\n<ul>\n<li>\u062f\u0631 \u0641\u0648\u0644\u062f\u0631 js1 \u06cc\u06a9 \u0641\u0648\u0644\u062f\u0631 \u0628\u0647 \u0646\u0627\u0645 2-02 \u0628\u0633\u0627\u0632\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u0628\u0647 \u0646\u0627\u0645 index.html \u062f\u0631 \u0622\u0646 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u0646\u062a\u0631\u0646\u0627\u0644 \u062f\u0631 \u0622\u0646 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u067e\u06cc\u0627\u0645 \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f:\n<div class=\"ltr tac\">Completed Successfully.<\/div>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-693\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/02-2.png\" \/><\/p>\n<h4>document<\/h4>\n<p>\u0622\u0628\u062c\u06a9\u062a document \u0645\u062d\u062a\u0648\u0627\u06cc \u062f\u0627\u062e\u0644 window \u0627\u0633\u062a.<\/p>\n<h4>document.write<\/h4>\n<p>\u0645\u062a\u062f\u00a0document.write\u00a0\u06cc\u06a9 \u0631\u0634\u062a\u0647 \u0645\u062a\u0646\u06cc \u0631\u0627 \u062f\u0631 \u062f\u0627\u062e\u0644 \u0628\u0631\u0648\u0632\u0631 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<pre><code class=\"js\">\r\n\/\/ Displaying a html\r\ndocument.write(\"&lt;h1&gt;Hello World!&lt;\/h1&gt;\");\r\n\r\n\/\/ Displaying a text\r\ndocument.write(\"Your number is: \");\r\n\r\n\/\/ Displaying a Number \r\ndocument.write(20); \/\/ Outputs: 20\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-694\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/write.png\" \/><\/p>\n<h4>document.<mark>getElementById<\/mark><\/h4>\n<p>\u0645\u062a\u062f\u00a0document.<mark>getElementById<\/mark> \u06cc\u06a9 \u0627\u0644\u0645\u0646\u062a \u0628\u0627 id \u062e\u0627\u0635\u06cc \u0631\u0627 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f.<\/p>\n<div class=\"code-header\">HTML<\/div>\n<pre><code class=\"html\">\r\n&lt;h1 id=\"greet\"&gt;Hello World!&lt;\/h1&gt;\r\n\r\n<\/code><\/pre>\n<div class=\"code-header\">JS<\/div>\n<pre><code class=\"js\">\r\n\/\/ Gets the element with the 'greet' id:\r\ndocument.getElementById(\"greet\");\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-695\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/getElementById.png\" \/><\/p>\n<h4>\u0622\u0646\u0627\u062a\u0648\u0645\u06cc \u0627\u0644\u0645\u0646\u062a HTML<\/h4>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-696\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/html-anatomy.png\" \/><\/p>\n<h4>element.innerHTML<\/h4>\n<p>\u0645\u062a\u062f\u00a0element.innerHTML \u0645\u062d\u062a\u0648\u0627\u06cc \u06cc\u06a9 \u0627\u0644\u0645\u0646\u062a \u0631\u0627 \u0628\u0631\u0645\u06cc\u200c\u06af\u0631\u062f\u0627\u0646\u062f \u06cc\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<div class=\"code-header\">HTML<\/div>\n<pre><code class=\"html\">\r\n&lt;h1 id=\"greet\"&gt;&lt;\/h1&gt;\r\n&lt;div id=\"msg\"&gt;&lt;\/div&gt;\r\n&lt;p id=\"no\"&gt;&lt;\/p&gt;\r\n\r\n<\/code><\/pre>\n<div class=\"code-header\">JS<\/div>\n<pre><code class=\"js\">\r\n\/\/ Displaying a text\r\ndocument.getElementById(\"greet\").innerHTML = \"Hello World!\";\r\n\r\n\/\/ Displaying a html\r\ndocument.getElementById(\"msg\").innerHTML = \"<b>Your number is:<\/b>\";\r\n\r\n\/\/ Displaying a Number \r\ndocument.getElementById(\"no\").innerHTML = 20;\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-697\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/innerHTML.png\" \/><\/p>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1024.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h4>\u062a\u0645\u0631\u06cc\u0646 \u06f3<\/h4>\n<ul>\n<li>\u0627\u06cc\u0646 <a href=\"https:\/\/behnudi.ir\/f\/js1\/02\/02-3.zip\">\u0641\u0627\u06cc\u0644<\/a>\u00a0\u0631\u0627 \u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u0622\u0646 \u0631\u0627 \u062f\u0631 \u0641\u0648\u0644\u062f\u0631 js1 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u0646\u062a\u0631\u0646\u0627\u0644 \u062f\u0631 \u0622\u0646 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u0646\u0627\u0645\u062a\u0627\u0646 \u0631\u0627 \u062f\u0631 \u062a\u06af h1 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-698\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/02-3.png\" \/><\/p>\n<h4>element.<mark>setAttribute<\/mark><\/h4>\n<p>\u0645\u062a\u062f element.<mark>setAttribute<\/mark> \u06cc\u06a9 \u0627\u062a\u0631\u06cc\u0628\u06cc\u0648\u062a \u0628\u0647 \u0627\u0644\u0645\u0646\u062a \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<div class=\"code-header\">HTML<\/div>\n<pre><code class=\"html\">\r\n&lt;h1 id=\"hi\"&gt;Hello World!&lt;\/h1&gt;\r\n\r\n<\/code><\/pre>\n<div class=\"code-header\">JS<\/div>\n<pre><code class=\"js\">\r\ndocument.getElementById(\"hi\").setAttribute(\"style\", \"color: red\");\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-699\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/setAttribute.png\" \/><\/p>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1025.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h4>\u062a\u0645\u0631\u06cc\u0646 \u06f4<\/h4>\n<ul>\n<li>\u0627\u06cc\u0646 <a href=\"https:\/\/behnudi.ir\/f\/js1\/02\/02-4.zip\">\u0641\u0627\u06cc\u0644<\/a>\u00a0\u0631\u0627 \u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u0622\u0646 \u0631\u0627 \u062f\u0631 \u0641\u0648\u0644\u062f\u0631 js1 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u0646\u062a\u0631\u0646\u0627\u0644 \u062f\u0631 \u0622\u0646 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u062a\u06af img \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u062f.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-700\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/02-4.png\" \/><\/p>\n<h4>element.<mark>style.property<\/mark><\/h4>\n<p>\u0645\u062a\u062f element.<mark>style.property<\/mark> \u06cc\u06a9 inline css \u0628\u0647 \u0627\u0644\u0645\u0646\u062a \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u067e\u0631\u0627\u067e\u0631\u062a\u06cc css \u0628\u0627\u06cc\u062f \u0627\u06cc\u0646\u062c\u0627 \u0628\u0647 \u0634\u06a9\u0644 <a href=\"https:\/\/behnudi.ir\/?p=335\" target=\"_blank\" rel=\"noopener\">camelCase<\/a> \u0646\u0648\u0634\u062a\u0647 \u0634\u0648\u062f.<\/p>\n<div class=\"code-header\">HTML<\/div>\n<pre><code class=\"html\">\r\n&lt;h1 id=\"hi\"&gt;Hello World!&lt;\/h1&gt;\r\n\r\n<\/code><\/pre>\n<div class=\"code-header\">JS<\/div>\n<pre><code class=\"js\">\r\ndocument.getElementById(\"hi\").style.color = \"red\";\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-699\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/setAttribute.png\" \/><\/p>\n<h4>element.<mark>onclick<\/mark><\/h4>\n<p>\u0627\u06cc\u0648\u0646\u062a element.<mark>onclick<\/mark> \u06cc\u06a9 \u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u06cc \u0627\u0632 \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0631\u0627 \u0647\u0646\u06af\u0627\u0645 \u06a9\u0644\u06cc\u06a9 \u0631\u0648\u06cc \u0627\u0644\u0645\u0646\u062a \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u0647 \u0627\u06cc\u0646 \u0645\u062c\u0645\u0648\u0639\u0647 \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0641\u0627\u0646\u06a9\u0634\u0646 (function) \u0645\u06cc\u200c\u06af\u0648\u06cc\u0646\u062f.<br \/>\n\u0641\u0627\u0646\u06a9\u0634\u0646: \u06cc\u06a9 \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u06a9\u0647 \u06a9\u0627\u0631 \u062e\u0627\u0635\u06cc \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u062f\u0647\u0646\u062f.\u00a0 \u062f\u0631 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0641\u0627\u0646\u06a9\u0634\u0646\u060c \u0628\u0647 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u06af\u0648\u0646\u0627\u06af\u0648\u0646\u06cc \u0646\u0648\u0634\u062a\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u06a9\u0647 \u062f\u0631 \u0622\u06cc\u0646\u062f\u0647 \u0628\u0627 \u0627\u0646\u0648\u0627\u0639 \u0622\u0646 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f. \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627\u00a0\u0633\u0627\u062f\u0647\u200c\u062a\u0631\u06cc\u0646 \u0634\u06a9\u0644 \u0622\u0646 \u0631\u0627 \u0645\u06cc \u0628\u06cc\u0646\u06cc\u062f:<\/p>\n<p dir=\"ltr\"><strong>function() {&#8230;}<\/strong><\/p>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0631\u0627 \u062f\u0631\u0648\u0646 <strong>{&#8230;} \u06a9\u0650\u0631\u0644\u06cc \u0628\u0650\u0631\u064e\u06a9\u0650\u062a Curly Bracket<\/strong> \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f.<\/p>\n<p>\u0631\u0648\u06cc \u062a\u0635\u0648\u06cc\u0631 \u0632\u06cc\u0631 \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/click.png\" width=\"150\" \/><\/p>\n<div class=\"code-header\">HTML<\/div>\n<pre><code class=\"html\">\r\n&lt;img src=\"photo.jpg\" id=\"pic\"\/&gt;\r\n\r\n<\/code><\/pre>\n<div class=\"code-header\">JS<\/div>\n<pre><code class=\"js\">\r\ndocument.getElementById(\"pic\").onclick = function(){ alert(\"Hi\"); }\r\n\r\n<\/code><\/pre>\n<p>\u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u06a9\u0646\u0633\u0648\u0644 \u0622\u0632\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u062f.<\/p>\n<hr \/>\n<p><video controls=\"controls\"><source src=\"https:\/\/behnudi.ir\/f\/js1\/02\/js1026.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<hr \/>\n<h4>\u062a\u0645\u0631\u06cc\u0646 \u06f5<\/h4>\n<ul>\n<li>\u0627\u06cc\u0646 <a href=\"https:\/\/behnudi.ir\/f\/js1\/02\/02-5.zip\">\u0641\u0627\u06cc\u0644<\/a>\u00a0\u0631\u0627 \u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u0622\u0646 \u0631\u0627 \u062f\u0631 \u0641\u0648\u0644\u062f\u0631 js1 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f.<\/li>\n<li>\u06cc\u06a9 \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u0646\u062a\u0631\u0646\u0627\u0644 \u062f\u0631 \u0622\u0646 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u062f\u0631 \u0635\u0648\u0631\u062a \u06a9\u0644\u06cc\u06a9 \u0631\u0648\u06cc \u062f\u06a9\u0645\u0647 \u062a\u0635\u0648\u06cc\u0631 \u0638\u0627\u0647\u0631 \u0634\u0648\u062f.<\/li>\n<\/ul>\n<p>\u0631\u0627\u0647\u0646\u0645\u0627\u06cc\u06cc:<\/p>\n<p class=\"code-header\">display: block;<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-732\" src=\"https:\/\/behnudi.ir\/f\/js1\/02\/img\/02-5.png\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u062f\u0633\u062a\u0648\u0631 \u0632\u0628\u0627\u0646 &#8211; Syntax \u062d\u0633\u0627\u0633 \u0628\u0647 \u0646\u0648\u0639 \u062d\u0631\u0641 (Case Sensitive): \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0647 \u06a9\u0648\u0686\u06a9\u06cc \u06cc\u0627 \u0628\u0632\u0631\u06af\u06cc \u062d\u0631\u0648\u0641 \u0627\u0647\u0645\u06cc\u062a \u0645\u06cc\u200c\u062f\u0647\u062f \u0648 \u0622\u0646\u0647\u0627 \u0631\u0627 \u062f\u0648 \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631 \u0645\u062a\u0641\u0627\u0648\u062a \u062f\u0631 \u0646\u0638\u0631 \u0645\u06cc \u06af\u06cc\u0631\u062f. (A \u2260 a) \u0628\u06cc \u062a\u0641\u0627\u0648\u062a \u0646\u0633\u0628\u062a \u0628\u0647 \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627: \u062c\u0627\u0648\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627 \u0631\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f. \u0641\u0627\u0635\u0644\u0647\u200c\u0647\u0627\u060c \u0633\u0631 \u062e\u0637 \u0631\u0641\u062a\u0646 \u0648 \u062a\u0648\u0631\u0641\u062a\u06af\u06cc\u200c\u0647\u0627 \u0647\u0645\u0647 \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u0627\u06cc\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0631\u0639\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f. \u062a\u0648\u0636\u06cc\u062d\u0627\u062a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1530,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[46,44],"class_list":["post-1557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","tag-javascript","tag-web-design"],"_links":{"self":[{"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/posts\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/behnudi.ir\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1557"}],"version-history":[{"count":0,"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/posts\/1557\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/behnudi.ir\/index.php?rest_route=\/wp\/v2\/media\/1530"}],"wp:attachment":[{"href":"https:\/\/behnudi.ir\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/behnudi.ir\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/behnudi.ir\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}