{"id":28682,"date":"2022-11-17T13:32:48","date_gmt":"2022-11-17T07:47:48","guid":{"rendered":"https:\/\/sabitatimalsina.com.np\/sabi\/?p=28682"},"modified":"2022-11-17T17:23:10","modified_gmt":"2022-11-17T11:38:10","slug":"web-technology","status":"publish","type":"post","link":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/","title":{"rendered":"WEB TECHNOLOGY"},"content":{"rendered":"\n<ol type=\"1\">\n<li><strong>Write a JavaScript function that checks password and retyped password of two different password fields are same or not.<\/strong><\/li>\n<\/ol>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;title&gt;web&lt;\/title&gt;<\/p>\n\n\n\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n\n\n\n<p>function validate(){<\/p>\n\n\n\n<p>var mypwd=document.myform.pwd.value;<\/p>\n\n\n\n<p>var myrpwd=document.myform.rpwd.value;<\/p>\n\n\n\n<p>if(mypwd !=myrpwd) {<\/p>\n\n\n\n<p>alert(&#8220;password doesn&#8217;t match&#8221;);<\/p>\n\n\n\n<p>return false;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>else{<\/p>\n\n\n\n<p>alert(&#8220;okay&#8221;);<\/p>\n\n\n\n<p>return true;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;form name=&#8221;myform&#8221;&gt;<\/p>\n\n\n\n<p>&lt;fieldset&gt;<\/p>\n\n\n\n<p>&lt;legend&gt;Confirm Password&lt;\/legend&gt;<\/p>\n\n\n\n<p>&lt;label&gt; Password: &lt;input type=&#8221;password&#8221; name=&#8221;pwd&#8221;&gt;&lt;\/label&gt;<\/p>\n\n\n\n<p>&lt;label&gt; Retype-Password: &lt;input type=&#8221;password&#8221; name=&#8221;rpwd&#8221;&gt;&lt;\/label&gt;<\/p>\n\n\n\n<p>&lt;button onclick=&#8221;return validate();&#8221;&gt;Confirm&lt;\/button&gt;<\/p>\n\n\n\n<p>&lt;\/fieldset&gt;<\/p>\n\n\n\n<p>&lt;\/form&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<ul>\n<li><strong>Write a JavaScript code to check if a number given by user is prime or not.<\/strong><\/li>\n<\/ul>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;title&gt;Prime check&lt;\/title&gt;<\/p>\n\n\n\n<p>&lt;script type=&#8221;text\/Javascript&#8221;&gt;<\/p>\n\n\n\n<p>var a=prompt (&#8220;Enter a num: &#8220;);<\/p>\n\n\n\n<p>var i, flag1=0; for(i=2; i&lt;a\/2;i++)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>if(i==0) {<\/p>\n\n\n\n<p>flag1=1;<\/p>\n\n\n\n<p>break;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>if(flag1==0) {<\/p>\n\n\n\n<p>document.write (a+&#8221; is a a prime number&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>else {<\/p>\n\n\n\n<p>document.write (a+&#8221; is not a prime number&#8221;); 0}<\/p>\n\n\n\n<p>&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p>3<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\" alt=\"Capture.JPG\"\/><\/figure>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;style&gt;<\/p>\n\n\n\n<p>table<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>border:1px solid black;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/style&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;table border=&#8221;width:50%&#8221;&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;th colspan=&#8221;2&#8243;&gt;Subject&lt;\/th&gt;<\/p>\n\n\n\n<p>&lt;th&gt; John Doe&lt;\/th&gt;<\/p>\n\n\n\n<p>&lt;th&gt;Mirim Luther&lt;\/th&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;td rowspan=&#8221;2&#8243;&gt;&lt;b&gt;Biology&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt;Practical&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt; A&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt; Theory&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A+&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt; A&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td rowspan=&#8221;2&#8243;&gt;&lt;b&gt;Chemistry&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt;Practical&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;B&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;C&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt;Theory&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;C+&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td rowspan=&#8221;2&#8243;&gt;&lt;b&gt;Physics&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt;Practicals&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A &lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;b&gt; Theory&lt;\/b&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A-&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;A-&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;\/table&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p>.<img decoding=\"async\" loading=\"lazy\" width=\"394\" height=\"165\" src=\"\" alt=\"Capture.JPG\"><\/p>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;head&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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p; .fr1{height:100px;width:800px;border-right:2px solid black;float:left;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .fr2{height:100px;width:200px;float:right;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .sr{height:300px;width:1000px;border-bottom:2px solid black;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .sr1{height:300px;width:200px;border-right:2px solid black;float:left;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;String 4&lt;\/title&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/head&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;body&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;script type=&#8221;text\/Javascript&#8221;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>str1=new String(&#8220;BIM Study Notes&#8221;);<\/p>\n\n\n\n<p>var a1=str1.length;<\/p>\n\n\n\n<p>str2=new String(&#8220;BIM Study Notes&#8221;);<\/p>\n\n\n\n<p>&nbsp;var a2=str2.length;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var i;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var count=0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(i=0;i&lt;=a1;i++)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/script&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p><strong>Why do we need to validate form values?<\/strong><\/p>\n\n\n\n<p><strong>Write JavaScript to validate a form with input name (can not be empty), and contact (must be 10 digit)<\/strong><\/p>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;script&gt;<\/p>\n\n\n\n<p>function validateForm() {<\/p>\n\n\n\n<p>&nbsp; var x = document.forms[&#8220;myForm&#8221;][&#8220;fname&#8221;].value;<\/p>\n\n\n\n<p>&nbsp; var y = document.forms[&#8220;myForm&#8221;][&#8220;Cname&#8221;].value;<\/p>\n\n\n\n<p>&nbsp; if (x == &#8220;&#8221;)<\/p>\n\n\n\n<p>&nbsp; {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; alert(&#8220;Name must be filled out&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; return false;<\/p>\n\n\n\n<p>&nbsp; }<\/p>\n\n\n\n<p>&nbsp; else if (y.length!=10)<\/p>\n\n\n\n<p>&nbsp; {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; alert(&#8220;Contact must be 10 digit&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; return false;<\/p>\n\n\n\n<p>&nbsp; }<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;form name=&#8221;myForm&#8221; action=&#8221;\/action_page.php&#8221; onsubmit=&#8221;return validateForm()&#8221; method=&#8221;post&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Name: &lt;input type=&#8221;text&#8221; name=&#8221;fname&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; Contact: &lt;input type=&#8221;text&#8221; name=&#8221;Cname&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;input type=&#8221;submit&#8221; value=&#8221;Submit&#8221;&gt;<\/p>\n\n\n\n<p>&lt;\/form&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p><strong>&nbsp; Write a java Script &nbsp;program to reverse the given input integer input to output.<\/strong><\/p>\n\n\n\n<p>&lt;!doctype html&gt;<\/p>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;script&gt;<\/p>\n\n\n\n<p>function palin()<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>var a,no,b,temp=0;<\/p>\n\n\n\n<p>no=Number(document.getElementById(&#8220;no_input&#8221;).value);<\/p>\n\n\n\n<p>b=no;<\/p>\n\n\n\n<p>while(no&gt;0)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>a=no%10;<\/p>\n\n\n\n<p>no=parseInt(no\/10);<\/p>\n\n\n\n<p>temp=temp*10+a;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>alert(temp);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>Enter any Number: &lt;input id=&#8221;no_input&#8221;&gt;<\/p>\n\n\n\n<p>&lt;button onclick=&#8221;palin()&#8221;&gt;Check&lt;\/button&gt;&lt;\/br&gt;&lt;\/br&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\" alt=\"aaadasdas.JPG\"\/><\/figure>\n\n\n\n<p>&lt;!DOCTYPE html&gt;<\/p>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;&lt;\/title&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var fruitArray=[&#8216;Apple&#8217;,&#8217;Orange&#8217;,&#8217;Mango&#8217;];<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fruitArray.unshift(&#8216;Strawberry&#8217;,&#8217;Bananan&#8217;,&#8217;Guava&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fruitArray.pop();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fruitArray.pop();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var stringArray=fruitArray.toString();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(stringArray);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p><strong>&nbsp; Write a html form for sending email with a form item like send to , cc, subject, message &amp; send button included.<\/strong><\/p>\n\n\n\n<p>&lt;!DOCTYPE html&gt;<\/p>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;form method=&#8221;post&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; Send to: &lt;input type=&#8221;email&#8221; name=&#8221;fname&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;br&gt;<\/p>\n\n\n\n<p>&nbsp; cc: &lt;input type=&#8221;email&#8221; name=&#8221;cc&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;br&gt;<\/p>\n\n\n\n<p>&nbsp; Subject: &lt;input type=&#8221;text&#8221; name=&#8221;sub&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;br&gt;<\/p>\n\n\n\n<p>&nbsp; Message: &lt;textarea name=&#8221;message&#8221; rows=&#8221;10&#8243; cols=&#8221;30&#8243;&gt;&lt;\/textarea&gt;<\/p>\n\n\n\n<p>&nbsp; &lt;input type=&#8221;submit&#8221; value=&#8221;Submit&#8221;&gt;<\/p>\n\n\n\n<p>&lt;\/form&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\" alt=\"sdasdadas.JPG\"\/><\/figure>\n\n\n\n<p>&lt;html&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;title&gt;this is title&lt;\/title&gt;<\/p>\n\n\n\n<p>&lt;style&gt;<\/p>\n\n\n\n<p>table, th, td{<\/p>\n\n\n\n<p>border: 1px solid black;<\/p>\n\n\n\n<p>border-collapse: collapse;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>th, td{<\/p>\n\n\n\n<p>padding: 10px;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/style&gt;<\/p>\n\n\n\n<p>&nbsp;&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;h1&gt;Students Details&lt;\/h1&gt;<\/p>\n\n\n\n<p>&lt;table width=&#8221;50%&#8221; height=&#8221;30%&#8221;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;th rowspan=&#8221;2&#8243;&gt;Name&lt;\/th&gt;<\/p>\n\n\n\n<p>&nbsp;&lt;th colspan=&#8221;3&#8243;&gt;Subjects&lt;\/th&gt;<\/p>\n\n\n\n<p>&nbsp;&lt;th rowspan=&#8221;2&#8243;&gt;total&lt;\/th&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;th&gt;computer&lt;\/th&gt;<\/p>\n\n\n\n<p>&lt;th&gt;account&lt;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t;td&gt; 30&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/table&gt;<\/p>\n\n\n\n<p>&nbsp;&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n\n\n\n<p>n the case of an Armstrong number of 3 digits, the sum of cubes of each digit is equal to the number itself. For example,&nbsp;<strong>153<\/strong>&nbsp;is an Armstrong number because<\/p>\n\n\n\n<p>153 = 1*1*1 + 5*5*5 + 3*3*3<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ program to check an Armstrong number of three digits<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">let<code> sum = <\/code>0<code>;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">const<code> number = prompt(<\/code>'Enter a three-digit positive integer: '<code>);<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ create a temporary variable<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">let<code> temp = number;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">while<code> (temp &gt; <\/code>0<code>) {<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; <\/code>\/\/ finding the one's digit<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; <\/code>let<code> remainder = temp % <\/code>10<code>;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;&nbsp;&nbsp; sum += remainder * remainder * remainder;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; <\/code>\/\/ removing last digit from the number<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; temp = <\/code>parseInt<code>(temp \/ <\/code>10<code>); <\/code>\/\/ convert float into integer<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ check the condition<code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">if<code> (sum == number) {<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; <\/code>console<code>.log(<\/code>`${number} is an Armstrong number`<code>);<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">else<code> {<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&nbsp;&nbsp;&nbsp; <\/code>console<code>.log(<\/code>`${number} is not an Armstrong number.`<code>);<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>}<\/code><\/pre>\n\n\n\n<p><strong>Check Number Type with if&#8230;else if&#8230;else<\/strong><\/p>\n\n\n\n<p>\/\/ program that checks if the number is positive, negative or zero<\/p>\n\n\n\n<p>\/\/ input from the user<\/p>\n\n\n\n<p>const number = parseInt(prompt(&#8220;Enter a number: &#8220;));<\/p>\n\n\n\n<p>\/\/ check if number is greater than 0<\/p>\n\n\n\n<p>if (number &gt; 0) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; console.log(&#8220;The number is positive&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ check if number is 0<\/p>\n\n\n\n<p>else if (number == 0) {<\/p>\n\n\n\n<p>&nbsp; console.log(&#8220;The number is zero&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ if number is less than 0<\/p>\n\n\n\n<p>else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#8220;The number is negative&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p><a href=\"https:\/\/www.programiz.com\/javascript\/online-compiler\" target=\"_blank\" rel=\"noreferrer noopener\">Run Code<\/a><\/p>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<p>Enter a number: 0<\/p>\n\n\n\n<p>The number is zero.<\/p>\n\n\n\n<p><strong>Check Prime Number<\/strong><\/p>\n\n\n\n<p>\/\/ program to check if a number is prime or not<\/p>\n\n\n\n<p>\/\/ take input from the user<\/p>\n\n\n\n<p>const number = parseInt(prompt(&#8220;Enter a positive number: &#8220;));<\/p>\n\n\n\n<p>let isPrime = true;<\/p>\n\n\n\n<p>\/\/ check if number is equal to 1<\/p>\n\n\n\n<p>if (number === 1) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; console.log(&#8220;1 is neither prime nor composite number.&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ check if number is greater than 1<\/p>\n\n\n\n<p>else if (number &gt; 1) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; \/\/ looping through 2 to number-1<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; for (let i = 2; i &lt; number; i++) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (number % i == 0) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isPrime = false;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; }<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; if (isPrime) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(`${number} is a prime number`);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; } else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(`${number} is a not prime number`);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; }<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ check if number is less than 1<\/p>\n\n\n\n<p>else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; console.log(&#8220;The number is not a prime number.&#8221;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<p>Enter a positive number: 23<\/p>\n\n\n\n<p>23 is a prime number.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;html&gt; &lt;head&gt; &lt;title&gt;web&lt;\/title&gt; &lt;script type=&#8221;text\/javascript&#8221;&gt; function validate(){ var mypwd=document.myform.pwd.value; var myrpwd=document.myform.rpwd.value; if(mypwd !=myrpwd) { alert(&#8220;password doesn&#8217;t match&#8221;); return false; } else{ alert(&#8220;okay&#8221;); return true; } } &lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; &lt;form name=&#8221;myform&#8221;&gt; &lt;fieldset&gt; &lt;legend&gt;Confirm Password&lt;\/legend&gt; &lt;label&gt; Password: &lt;input type=&#8221;password&#8221; name=&#8221;pwd&#8221;&gt;&lt;\/label&gt; &lt;label&gt; Retype-Password: &lt;input type=&#8221;password&#8221; name=&#8221;rpwd&#8221;&gt;&lt;\/label&gt; &lt;button onclick=&#8221;return validate();&#8221;&gt;Confirm&lt;\/button&gt; &lt;\/fieldset&gt; &lt;\/form&gt; &lt;\/body&gt; &lt;\/html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Prime check&lt;\/title&gt; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":28691,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,3,7,106,109,5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WEB TECHNOLOGY | Sabita Timalsina<\/title>\n<meta name=\"description\" content=\"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WEB TECHNOLOGY | Sabita Timalsina\" \/>\n<meta property=\"og:description\" content=\"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\" \/>\n<meta property=\"og:site_name\" content=\"Sabita Timalsina\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-17T07:47:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-17T11:38:10+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sabitatimalsina.com.np\/sabi\/wp-content\/uploads\/2022\/11\/sabita1-4-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sabita Timalsina\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sabita Timalsina\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\"},\"author\":{\"name\":\"Sabita Timalsina\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/9a7fa27aa9787365b842ec1f3bcfbe56\"},\"headline\":\"WEB TECHNOLOGY\",\"datePublished\":\"2022-11-17T07:47:48+00:00\",\"dateModified\":\"2022-11-17T11:38:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\"},\"wordCount\":3235,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#organization\"},\"articleSection\":[\"Book\",\"Engineering\",\"Information\",\"Notes\",\"TRENDING\",\"Tricks and Tips\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\",\"url\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\",\"name\":\"WEB TECHNOLOGY | Sabita Timalsina\",\"isPartOf\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#website\"},\"datePublished\":\"2022-11-17T07:47:48+00:00\",\"dateModified\":\"2022-11-17T11:38:10+00:00\",\"description\":\"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;\",\"breadcrumb\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sabitatimalsina.com.np\/sabi\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WEB TECHNOLOGY\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#website\",\"url\":\"https:\/\/sabitatimalsina.com.np\/sabi\/\",\"name\":\"Sabita Timalsina\",\"description\":\"Always up to date\",\"publisher\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sabitatimalsina.com.np\/sabi\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#organization\",\"name\":\"\u0916\u092c\u0930 \u0928\u094d\u092f\u0941\u091c \u0928\u0947\u092a\u093e\u0932\",\"url\":\"https:\/\/sabitatimalsina.com.np\/sabi\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/logo\/image\/\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"\u0916\u092c\u0930 \u0928\u094d\u092f\u0941\u091c \u0928\u0947\u092a\u093e\u0932\"},\"image\":{\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/9a7fa27aa9787365b842ec1f3bcfbe56\",\"name\":\"Sabita Timalsina\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ae96fa507583c3d68556104618c70280?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ae96fa507583c3d68556104618c70280?s=96&d=mm&r=g\",\"caption\":\"Sabita Timalsina\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WEB TECHNOLOGY | Sabita Timalsina","description":"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/","og_locale":"en_US","og_type":"article","og_title":"WEB TECHNOLOGY | Sabita Timalsina","og_description":"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;","og_url":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/","og_site_name":"Sabita Timalsina","article_published_time":"2022-11-17T07:47:48+00:00","article_modified_time":"2022-11-17T11:38:10+00:00","og_image":[{"width":2560,"height":1707,"url":"http:\/\/sabitatimalsina.com.np\/sabi\/wp-content\/uploads\/2022\/11\/sabita1-4-scaled.jpg","type":"image\/jpeg"}],"author":"Sabita Timalsina","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sabita Timalsina","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#article","isPartOf":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/"},"author":{"name":"Sabita Timalsina","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/9a7fa27aa9787365b842ec1f3bcfbe56"},"headline":"WEB TECHNOLOGY","datePublished":"2022-11-17T07:47:48+00:00","dateModified":"2022-11-17T11:38:10+00:00","mainEntityOfPage":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/"},"wordCount":3235,"commentCount":0,"publisher":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#organization"},"articleSection":["Book","Engineering","Information","Notes","TRENDING","Tricks and Tips"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/","url":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/","name":"WEB TECHNOLOGY | Sabita Timalsina","isPartOf":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#website"},"datePublished":"2022-11-17T07:47:48+00:00","dateModified":"2022-11-17T11:38:10+00:00","description":"Write a JavaScript function that checks password and retyped password of two different password fields are same or not. &lt;html&gt; &lt;head&gt;","breadcrumb":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/web-technology\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sabitatimalsina.com.np\/sabi\/"},{"@type":"ListItem","position":2,"name":"WEB TECHNOLOGY"}]},{"@type":"WebSite","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#website","url":"https:\/\/sabitatimalsina.com.np\/sabi\/","name":"Sabita Timalsina","description":"Always up to date","publisher":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sabitatimalsina.com.np\/sabi\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#organization","name":"\u0916\u092c\u0930 \u0928\u094d\u092f\u0941\u091c \u0928\u0947\u092a\u093e\u0932","url":"https:\/\/sabitatimalsina.com.np\/sabi\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/logo\/image\/","url":"","contentUrl":"","caption":"\u0916\u092c\u0930 \u0928\u094d\u092f\u0941\u091c \u0928\u0947\u092a\u093e\u0932"},"image":{"@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/9a7fa27aa9787365b842ec1f3bcfbe56","name":"Sabita Timalsina","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sabitatimalsina.com.np\/sabi\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ae96fa507583c3d68556104618c70280?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ae96fa507583c3d68556104618c70280?s=96&d=mm&r=g","caption":"Sabita Timalsina"}}]}},"_links":{"self":[{"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/posts\/28682"}],"collection":[{"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/comments?post=28682"}],"version-history":[{"count":2,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/posts\/28682\/revisions"}],"predecessor-version":[{"id":28685,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/posts\/28682\/revisions\/28685"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/media\/28691"}],"wp:attachment":[{"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/media?parent=28682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/categories?post=28682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sabitatimalsina.com.np\/sabi\/wp-json\/wp\/v2\/tags?post=28682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}