[Solved] Difference between getElementById and createElement in javascript? [closed]

The main difference is that getElementById will get an element from the DOM by it’s ID attribute, and createElement will create an entirely new DOM element. Let’s say you had a page with the following HTML: <!doctype html> <html> <head> </head> <body> <div>Hello, World!</div> <div id=”message”>What a nice day!</div> </body> </html> And then you had … Read more

[Solved] Is it important to declare [duplicate]

Simple Google will solve more than 95% of your early questions into coding 😉 https://en.wikipedia.org/wiki/Document_type_declaration#HTML_4.01_DTDs and https://en.wikipedia.org/wiki/Document_type_definition The short summary: HTML is a subset of XML (eXtensible Markup Language) with specified tags. In XML you can use a wide range of custom tags (called elements) like <price value=”10″ currency=”euro”></price> So to bring order and consistency … Read more

[Solved] Is it Possible to Run Shell Script in Browser

You would need to use a Java Applet with heightened security privileges and a JavaScript API so that JavaScript in the page could read the form data and pass it to the applet. The client computer would need to have the Java plugin and whatever shell you were using installed, and the user would have … Read more

[Solved] Is it Possible ? To check student information by Roll no: using simple webpage in html + javascript

Take this: var studentArray = [{rollno:’rollno1′, fname:’fname1′, marks:’marks1′, institute:’institute1′, percentage: ‘percentage1′},{rollno:’rollno2′, fname:’fname2′, marks:’marks2′, institute:’institute2’, percentage: ‘percentage2’}]; document.getElementById(“search”).addEventListener(‘click’, function() { var roll = document.getElementById(“roll”).value; var student, info; for (i = 0; i < studentArray.length; i++) { student = studentArray[i]; if (student.rollno == roll) { info = “First Name: ” + student.fname + “<br />”; info += … Read more

[Solved] Seamless onClick animated s

Use this as the basis to fit it to you use-case. Works on hover on any section. Snippet: * { box-sizing: border-box; margin: 0; padding: 0; font-family: sans-serif; } .parent { width: 100vw; height: 120px; display: flex; flex-direction: columns; } .parent > div { background-color: #ddd; text-align: center; padding: 12px 8px; flex: 1 1 10%; … Read more

[Solved] jQuery doesn’t work on Notepad++

It’s a typo in your script tag, change scr <script scr=”https://stackoverflow.com/questions/45972334/jquery.js”></script> to src <script src=”https://stackoverflow.com/questions/45972334/jquery.js”></script> solved jQuery doesn’t work on Notepad++

[Solved] Is there any way keep part of my code in a seperate document? [closed]

I’m guessing the block of data you want to move to a separate file is also HTML code? If so, you can do this: Move that block of code into a separate .html file and insert this line into your page: <object type=”text/html” data=”yourFile.html” style=”height:300px; width:96%; margin:2%;”></object> The height, width, and margin should be like … Read more

[Solved] How to put a space in front of a next line [closed]

You could use a pseudo-element to insert the : and keep the space of those along the text: <div class=”col-xs-6 doublep”><span>I am a noob</span></div> .doublep { font-size: 0; white-space: nowrap; } .doublep:before { width: 15px; text-align: Center; font-size: 14px; content: “:”; display: inline-block; vertical-align: top; } .doublep span { white-space: normal; font-size: 14px; display: inline-block; … Read more

[Solved] Whats wrong with this $return?

You’ve got <?php ?> inside existing PHP code. You cannot nest <?php ?>. Since you are using double quotes, simple variables like $kinsource will be interpolated but the function call to get_bloginfo() will have to be concatenated in. Switch all other double quotes inside the string to single quotes. $return .= “<a href=”https://stackoverflow.com/questions/9354628/$kinsource” class=”lightbox” rel=”pics”><img … Read more

[Solved] check radio button when the mouse is over it [closed]

<!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <meta name=”viewport” content=”width=device-width”> <title>JS Bin</title> <style> </style> </head> <body> <label> <input type=”radio” name=”photo” data-image=”http://placehold.it/350×150″ class=”radio-hover”> Option – 1 </label> <label> <input type=”radio” name=”photo” data-image=”http://placehold.it/250×150″ class=”radio-hover”> Option – 2 </label> <br> <img src=”http://placehold.it/350×150″ class=”photo1″ alt=””> <script src=”https://code.jquery.com/jquery-3.1.0.js”></script> <script> $(“.radio-hover”).hover(function(){ var imageUrl = $(this).data(“image”); $(“img”).show(); $(“img”).attr(“src”,imageUrl); },function(){ $(“img”).hide(); }); </script> </body> … Read more

[Solved] get title from heading tag

For the given html, the following will print the content inside each heading. var headings = document.getElementsByTagName(‘h1’); for(i=0;i<headings.length;i++){ console.log(headings[i].innerHTML); } solved get title from heading tag

[Solved] i want to sum 6 inputs and set the value to another input with javascript [closed]

Check the fiddle: https://jsfiddle.net/1qbjd36c/13/ $(“form .form-control”).not(“#thesum”).on(“input”, function() { var getSum = 0; $(“form .form-control”).not(“#thesum”).filter(function() { if($.isNumeric($(this).val())) return $(this).val(); }).each(function() { getSum+=parseFloat($(this).val()); }); $(“#thesum”).val(getSum); }); $(“form .form-control”) A tag and class selector has been utilized to reference the target. not(“#thesum”) added a not selector in order to avoid the change of input of Resulting TEXT field. … Read more