What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-29 02:59:14
selected dropdown value
Plain JavaScript: =================== var e = document.getElementById("elementId"); var value = e.options[e.selectedIndex].value; var text = e.options[e.selectedIndex].text; --------------------------------------------------------- jQuery: =====... Add solution -
Javascript 2021-10-28 08:03:06
change image src using jquery
//change image src with jquery $("#myImageID").attr("src","images/my_other_image.png"); //change image src plain javascript document.getElementById('myImageID').src="images/my_other_image.png"; Add solution -
Html 2021-10-25 03:33:13
jquery add a new html element based on a template with variables
<script id="hidden-template" type="text/x-custom-template"> <tr> <td>Foo</td> <td>Bar</td> <tr> </script> then in javascript: var template = $('#hidden-template'... Add solution -
Javascript 2021-10-23 18:55:12
jquery change picture source
//change image src with jquery $("#myImageID").attr("src","images/my_other_image.png"); //change image src plain javascript document.getElementById('myImageID').src="images/my_other_image.png"; Add solution -
Javascript 2021-10-22 16:24:11
create dynamic element in javascript
<!DOCTYPE HTML> <html> <head> <title> How to dynamically create new elements in JavaScript? </title> </head> <body> <h1 style="text-align:center; color:green;"> GeeksForGeeks </h1>... Add solution -
Javascript 2021-10-22 04:41:08
! before variable javascript
// ! before a boolean variable will reverse the value: var test = true; console.log(test); // True console.log(!test); // False // In JavaScript, every value has an inherent boolean value. // If you use ! on a string, for instance, it will convert the va... Add solution -
Javascript 2021-10-21 15:25:12
javascript use css custom properties
Values in JavaScript To use the values of custom properties in JavaScript, it is just like standard properties. // get variable from inline style element.style.getPropertyValue("--my-var"); // get variable from wherever getComputedStyle(element... Add solution -
Javascript 2021-10-21 01:04:05
javascript find prime number
// This seems to be the most common and comprehensive means // of implementing a 'is a number a prime function' in javascript // if you would like t0 learn more complex , but efficient algorithms. // Visit the link below // https://stackoverflow.com/que... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5