Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 686 results

  1. The intro to w3.css says "Uses standard CSS only (No jQuery or JavaScript library)" which is technically true but a bit misleading. Javascript must be enabled in the user's browser in order to use useful features like modal popups. What's the big deal? Someone might create a website using a modal popup for users to register or purchase things, only to find that visitors using screen readers because they're visually impaired can no longer participate or buy things. So the site is no longer fully accessible, which is illegal in some countries and some class action lawsuits have already happened. I'm not saying features that use scripting aren't useful, but they should come with a big accessibility health warning to remind developers to include alternative ways to access things. It's easy to forget because most development is done with scripting enabled.
  2. Here my question is how to print/display the numbers from pressed buttons(as shown in figure) using JavaScript. However, here I am working on a device and we have to control it from JavaScript. Below I have mentioned my code(.js) snippet:// Numbers functionfunction Numbers(cmd){System.Print("Command Sent is: "+cmd);var num = cmd;System.Print("Button pressed is: "+num);}// Displaying Numbersfunction Display(){Numbers(num);num.toString();dbgPrint("Displaying number: " + num);}And parameters for this function I am passing from some other file(.xml) as standard.<function name="Display" export="Display"><parameter name="display" type="string" description="Drag and drop this for clear-button function."></parameter></function><function name="Numbers" export="Numbers"><parameter name="command" type="mcinteger" description="Drag and drop this command for Numbers."><choice name="1" value="1"/><choice name="2" value="2"/><choice name="3" value="3"/><choice name="4" value="4"/><choice name="5" value="5"/><choice name="6" value="6"/><choice name="7" value="7"/><choice name="8" value="8"/><choice name="9" value="9"/><choice name="0" value="0"/></parameter></function>
  3. LOOK why the live preview isn't working, what the wrong of the javascript code?
  4. Dear W3Schools-Community, There is something not working with my code right here. It should be mentioned that I am fairly new to using JavaScript. Here is my HTML code (stripped down to the essential parts): <!DOCTYPE html> <html lang="de"> <head> <script type="text/javascript"> function change_content(contentname) { if (document.getElementById(contentname).className = 'notactive') { document.getElementById('login').className = 'notactive'; document.getElementById('news').className = 'notactive'; document.getElementById('info').className = 'notactive'; document.getElementById('websites').className = 'notactive'; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById('content').innerHTML = this.responseText; if (contentname == 'kontakt' || contentname == 'hilfe' || contentname == 'impressum') { document.getElementById('info').className = 'active'; } else { document.getElementById(contentname).className = 'active'; } } }; xmlhttp.open('POST', contentname + 'page.php', true); xmlhttp.send(); } if (document.getElementById('info').className == 'active') { document.getElementById('dropdown-icon').src = "/ressource/images/nydoo-dropdown-icon-black.png"; } else { document.getElementById('dropdown-icon').src = "/ressource/images/nydoo-dropdown-icon-yellow.png"; } } window.onload = change_content; </script> </head> <header> <ul id="mainnavigation"> <li id="mainlist" class="dropdown"><a id="info" class="notactive" onclick="change_content(this.id);">Information<img id="dropdown-icon" style="width: 15px; height: 12px; float: right; margin-top: 7px; margin-right: 20px;" src="/ressource/images/nydoo-dropdown-icon-yellow.png" id="dropdown_icon"></a></li> </ul> </header> <body onload="change_content('login'); return false;"> <div id="content"> </div> </body> </html> What I'm trying to do is changing the color from img (id="dropdown-icon") from yellow to black whenever a (id="info") has class "active". Also the other way around (class "notactive" -> change from black to yellow). Hopefully this describes it. It maybe a simple thing. But I'm getting frustrated with this issue. Let me know if I screwed it up myself :3 Thank you very much n advance.
  5. Hi, I have written javascript code as below to make in HmacSHA256 but i need in RSASHA256 to generate signature, can you plz help. public key= -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -----END PUBLIC KEY----- Private Key= -----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== -----END RSA PRIVATE KEY----- JS code: <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js"></script>; <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js"></script>; function aaa(message,secret) { var hash = CryptoJS.HmacSHA256("message", "secret"); var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); return hashInBase64 }
  6. Hi, I have written javascript code as below to make in HmacSHA256 but i need in RSASHA256 to generate signature, can you plz help. public key= -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -----END PUBLIC KEY----- Private Key= -----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== -----END RSA PRIVATE KEY----- JS code: <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js"></script>; <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js"></script>; function aaa(message,secret) { var hash = CryptoJS.HmacSHA256("message", "secret"); var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); return hashInBase64 }
  7. I am attempting to use a meta tag to redirect someone if they attempt to go to a specified number of pages. Problem is these pages are pdf files so I cant really add some code to that. Anyway I decided to use a javascript file and import React and ReactDOM from the JS Library. I simply don't know what I am doing wrong with this code though. If anyone could help that would be amazing! import React from 'react'; import ReactDOM from 'react-dom'; String[] Directory = {"A", "Bunch", "Of", "Website", "Directories", "Here"}; if (window.location.href = "Website name here" + Directory)) { ReactDOM.render( <META http-equiv="refresh" content="0;URL=Index.html">, document.getElementById('app') ); }; Much Appreciated to whoever can help!
  8. Hello everyone, I am trying to make my first website and have been going through some javascript examples on W3S to learn how to make a website more interactive. I have been looking at the code for modal login and signup forms found here: https://www.w3schools.com/howto/howto_css_login_form.asp and here: https://www.w3schools.com/howto/howto_css_signup_form.asp The HTML and CSS are easy enough to understand I think, but I seem to be having some trouble with the JS aspect of the tutorials. What I have done is simply add both forms to an HTML document, linked to the styling and that seems to be working fine. The problem is when I click outside of the form the display for the modal forms should be set to none by the javascript code but this only works for one button. I have been able to rearrange some of the code so the second button works but then the first button wouldn't work. I have the code listed below. I've been trying this for a few days and would really like some help. Thanks in advance. HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Website3</title> <link rel="stylesheet" href="reset.css"> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="login.css"> </head> <body> <div id="outerMain"> <div id="main"> <header> <button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Login</button> <button onclick="document.getElementById('id02').style.display='block'" style="width:auto;">Sign Up</button> <div id="id01" class="modal"> <form class="modal-content animate" action="/action_page.php"> <div class="imgcontainer"> <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span> <img src="logo.png" alt="Avatar" class="avatar"> </div> <div class="container"> <label><b>Username</b></label> <input type="text" placeholder="Enter Username" name="uname" required> <label><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <button type="submit">Login</button> <input type="checkbox" checked="checked"> Remember me </div> <div class="container" style="background-color:#f1f1f1"> <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button> <span class="psw">Forgot <a href="#">password?</a></span> </div> </form> </div> <div id="id02" class="modal"> <form class="modal-content animate" action="/action_page.php"> <div class="imgcontainer"> <span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">&times;</span> </div> <div class="container"> <label><b>Email</b></label> <input type="text" placeholder="Enter Email" name="email" required> <label><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <label><b>Repeat Password</b></label> <input type="password" placeholder="Repeat Password" name="psw-repeat" required> <input type="checkbox" checked="checked"> Remember me <p>By creating an account you agree to our <a href="#">Terms & Privacy</a>.</p> <div class="clearfix"> <button type="button" onclick="document.getElementById('id02').style.display='none'" class="cancelbtn">Cancel</button> <button type="submit" class="signupbtn">Sign Up</button> </div> </div> </form> </div> <script src="scripts.js"> </script> </header> <section> <center><img src="centerimg.png" alt=""></center> </section> </div> </div> <footer> <center>HERE IS THE FOOTER!!</center> </footer> </body> </html> Javascript: var login = document.getElementById('id01'); var modal = document.getElementById('id02'); console.log(login); console.log(modal); if(login == document.getElementById('id01')){ console.log(login); window.onclick = function(event) { if (event.target == login) { login.style.display = "none"; } }; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } }; CSS: html,body{ height: 100%; } #outerMain { min-height: 100%; } #main{ overflow: auto; padding-bottom: 100px; background-color: green; } header{ background-color: blue; } /* Full-width input fields */ input[type=text], input[type=password] { width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; box-sizing: border-box; } /* Set a style for all buttons */ button { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; } button:hover { opacity: 0.8; } /* Extra styles for the cancel button */ .cancelbtn { width: auto; padding: 10px 18px; background-color: #f44336; } /* Center the image and position the close button */ .imgcontainer { text-align: center; margin: 24px 0 12px 0; position: relative; } img.avatar { width: 40%; border-radius: 50%; } .container { padding: 16px; } span.psw { float: right; padding-top: 16px; } /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ padding-top: 60px; } /* Modal Content/Box */ .modal-content { background-color: #fefefe; margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */ border: 1px solid #888; width: 80%; /* Could be more or less, depending on screen size */ } /* The Close Button (x) */ .close { position: absolute; right: 25px; top: 0; color: #000; font-size: 35px; font-weight: bold; } .close:hover, .close:focus { color: red; cursor: pointer; } /* Add Zoom Animation */ .animate { -webkit-animation: animatezoom 0.6s; animation: animatezoom 0.6s } @-webkit-keyframes animatezoom { from {-webkit-transform: scale(0)} to {-webkit-transform: scale(1)} } @keyframes animatezoom { from {transform: scale(0)} to {transform: scale(1)} } /* Change styles for span and cancel button on extra small screens */ @media screen and (max-width: 300px) { span.psw { display: block; float: none; } .cancelbtn { width: 100%; } }
  9. I have created some js file to change the height of my header when a user scrolls through it. The goal is that the header starts at 90% of the window height (90vh in css) when the page is loaded and it shrinks down to 80px when a user starts scrolling down (if the user goes back to the top of the page it will again grow to 90%). Also I want a gif playing in the back behind the header. The code works, but when you scroll down/up it seems to be lagging, but I would like it to fluently do these actions. Can anyone can give me some hints on how to improve the speed? Here is my code for these actions: HTML <html> <body> <div id="header-back" class="col12"></div> <div id="header" class="col12"></div> <div id="main" class="col12"></div> </body> </html> CSS /****** GRID VIEW ******/ [class*="col"] { width: 100%; } @media only screen and (min-width: 850px) { .col1 {width: 8.33%;} .col2 {width: 16.67%;} .col3 {width: 25.00%;} .col4 {width: 33.33%;} .col5 {width: 41.67%;} .col6 {width: 50.00%;} .col7 {width: 58.33%;} .col8 {width: 66.67%;} .col9 {width: 75.00%;} .col10 {width: 83.33%;} .col11 {width: 91.67%;} .col12 {width: 100.00%;} .col {width: auto;} } * { font-family: Trebuchet MS; border: 0px solid black; box-sizing: border-box; } body { width: 100vw; min-height: 100vh; margin: 0; } /* HEADER */ #header { height: 90vh; min-height: 80px; max-height: 90vh; background-color: rgba(30,30,30,0.8); position: fixed; top: 0; left: 0; box-shadow: 0 0 15px rgb(0,0,0); z-index: 2; } #header-back { height: 90vh; min-height: 80px; max-height: 90vh; position: fixed; top: 0; left: 0; z-index: 1; background-image: url("https://media.giphy.com/media/wyBcwFyH2FpO8/giphy.gif"); background-position: bottom left; background-size: cover; } /* MAIN */ #main { min-height: 100vh; padding-top: 90vh; background-color: rgb(230,230,230); } Javascript // change header size on scroll $(document).ready(function(){ // variables var vh90 = $(window).height()*(9/10); var height, color, opacity; // control height of header on scroll $(window).scroll(function(){ height = vh90 - $(window).scrollTop(); opacity = 1 - ( (height-80) / vh90 ) * 0.2; color = "rgba(30,30,30," + opacity + ")"; $("#header").css({"height": height, "background-color": color}); $("#header-back").css({"height": height}); }); }); I have created a jsfiddle to show my idea, but in the fiddle it seems to be working fluently (I used another gif, but I don't think this is the problem because this gif gets loaded at the start and doesn't really go away?)
  10. I've got a function that create mesh when you click on another. On the click, 2 or 3 mesh are created and go to their positions. Know i would like to do the reverse function : when the mesh are deployed, and you click anoter time on the mesh, the previously created mesh go back and are removed from the scene. Here is my first function : function sortiSphere(element, obj) { var matStdParams = { roughness: 1, metalness: 0.8, color: element.group, emissive: element.group, emissiveIntensity: 0.5 }; var sphereMaterial2 = new THREE.MeshStandardMaterial(matStdParams); var mesh = new THREE.Mesh(sphereGeometry, sphereMaterial2); mesh.position.x = x; mesh.position.y = y; mesh.position.z = z; mesh.userData.children = element.children; mesh.userData.name = element.label; mesh.userData.rang = element.rang; mesh.userData.def = element.définition; mesh.userData.posx = element.posx; mesh.userData.posy = element.posy; mesh.userData.posz = element.posz; mesh.userData.parent = obj; mesh.userData.cartabs = element.cartabs; mesh.position.normalize(); mesh.position.multiplyScalar(1 / element.rang); mesh.scale.set(1 / (element.rang / 2), 1 / (element.rang / 2), 1 / (element.rang / 2)) mesh.position.x = obj.position.x; mesh.position.y = obj.position.y; mesh.position.z = obj.position.z; var x = element.posx; var y = element.posy; var z = element.posz; new TWEEN.Tween(mesh.position).to({ x: x, y: y, z: z }, 1000) .easing(TWEEN.Easing.Elastic.Out).start(); console.log(mesh); scene.add(mesh); lesMesh.push(mesh) // lines var material = new THREE.LineBasicMaterial({ color: 0xffffff }); var geometry = new THREE.Geometry(); geometry.vertices.push( obj.position, new THREE.Vector3(x, y, z) ); var line = new THREE.Line(geometry, material); scene.add(line); gen1 = []; gen2 = []; gen3 = []; gen4 = []; gen5 = []; obj.userData.bool = true; }; Notice that the mesh contain a information about their state : userData.bool (true if deployed, false if not) Now, how do I tell them to go back ? Here is what I got for now : function deleteSphere(element, obj) { console.log("--- deleteSphere / debut fonction") for (i = 0; gen1.length > i; i++) { if (gen1[i].userData.children) { for (j = 0; gen1[i].userData.children.length > j; j++) { console.log(gen2[i][j]); scene.remove(gen2[i][j]);} } else { scene.remove(gen1[i]) console.log(gen1[i].userData.children) } } }; Thanks for your time
  11. My suggestion is to add HTML DOM element object outerHTML attribute for the JavaScript reference. It seems that most, if not all, the browsers support this attribute. In addition, it is important and basic attribute that new JavaScript developers should know about.
  12. Hello, I try to place meshs on sphere depending on their rank in a json file. I am looking for a way to define the position of my meshs in my loop in order to prevent them to be created on each other. function onMouseGauche(event) { event = event || window.event; if (event.button == 0) { mouse.x = (event.clientX / window.innerWidth) * 2 - 1; mouse.y = -(event.clientY / window.innerHeight) * 2 + 1; // update the picking ray with the camera and mouse position raycaster.setFromCamera(mouse, camera); // calculate objects intersecting the picking ray var intersects = 0; intersects = raycaster.intersectObjects(scene.children); if (intersects.length > 0) { if (intersects[0].object.userData.bool != true) { // Scalar = Scalar + 400; Scalar = Scalar / 1; Scale = Scale / 1; console.log(intersects[0].object.userData) if (intersects[0].object.userData.children) { var loop = 0; intersects[0].object.userData.children.forEach(function(element) { var sphereMaterial2 = new THREE.MeshBasicMaterial({ color: element.group }); var mesh = new THREE.Mesh(sphereGeometry, sphereMaterial2); var phi = ( 2 * Math.PI) var theta = (2 * Math.PI) var x = Math.random() * 2 - 1; var y = Math.random() * 2 - 1; var z = Math.random() * 2 - 1; // if (loop == 0) { // var x = Math.random() * 2 - 1; // var y = Math.cos(theta) * Math.random(); // var z = Math.cos(phi) * Math.random() // } // if (loop == 1) { // var x = Math.cos(phi) * Math.random(); // var y = Math.random() * 2 - 1; // var z = Math.cos(theta) * Math.random() // } // if (loop == 2) { // var x = Math.tan(phi) * Math.random(); // var y = Math.tan(theta) * Math.random(); // var z = Math.random() * 2 - 1 // } mesh.position.x = x; mesh.position.y = y; mesh.position.z = z; mesh.userData.children = element.children; mesh.userData.name = element.label; mesh.userData.rang = element.rang; mesh.position.normalize(); mesh.position.multiplyScalar(Scalar / element.rang); mesh.scale.set(Scale / element.rang, Scale / element.rang, Scale / element.rang) mesh.position.x = mesh.position.x + intersects[0].object.position.x; mesh.position.y = mesh.position.y + intersects[0].object.position.y; mesh.position.z = mesh.position.z + intersects[0].object.position.z; console.log(element) scene.add(mesh); // lines var material = new THREE.LineBasicMaterial({ color: 0xffffff }); var geometry = new THREE.Geometry(); geometry.vertices.push( intersects[0].object.position, mesh.position ); var line = new THREE.Line(geometry, material); scene.add(line); intersects[0].object.userData.bool = true; loop = loop + 1 }); } } } } // ajouter position de caméra actuelle camera.userData.push([Math.round(camera.position.x), Math.round(camera.position.y), Math.round(camera.position.z)]) } Here is the function that draw the sphere meshs. How can i define my coordinates more efficiently? Thank you
  13. QUESTION ONE: Please suggest what might be entered where the three ? marks appear in order to achieve the following goal. THE GOAL: See appear the value of mil in the input control text field and have this value become the value of $_POST['item_encllength'] when the form is submitted. var min = $('#min').val(); var sec = $('#sec').val(); var mil = function(min, sec) { var millisec = ((min * 60) + sec) * 1000; return millisec; } $('#item_encllength').mousedown(mil, function() { $(this).???; }); <input id='min' type='number' value='Minutes'> <input id='sec' type='number' value='Seconds'> <input id='item_encllength' form='rss2_feed' type='text' name='item_encllength'> I have experimented in a variety of ways, but have not been able to find the code necessary to achieve my goal. Perhaps my approach to the problem is inappropriate. Roddy
  14. I have a coded servlet already in HTTP url. I want to access and display the data from (http url) servlet to my new JSP within <div> here is the more details :https://gist.github.com/theakathir/f6fb390d35b451a57958aa0d3cf05330 about the servlet content. I am very new Ajax,. All i want to do in, In my new jsp page i will have a button to click which will access the data from the http url (servlet) using Ajax. Can someone direct me with some reference to start with.. It would be helpful Thanks.
  15. Evening, I have very, very limited knowledge of javascript, and I've run into a problem I can't seem to resolve. I have an animated hamburger menu, which when clicked/tapped shows a div (that is later to contain an accordion menu). The toggle on/off script works fine, but whenever I add the script to animate the hamburger menu, it seems to override the toggle on/off script and does not work. Can anyone please steer me in the right direction or offer some advice on where I am going wrong. Many thanks. <head> <meta charset="utf-8"> <style> #mob-menu { width: 100%; padding: 50px 0; text-align: center; background-color: lightblue; margin-top:20px; } .container { display: inline-block; cursor: pointer; } .bar1, .bar2, .bar3 { width: 35px; height: 5px; background-color: #333; margin: 6px 0; transition: 0.4s; } .change .bar1 { -webkit-transform: rotate(-45deg) translate(-9px, 6px) ; transform: rotate(-45deg) translate(-9px, 6px) ; } .change .bar2 {opacity: 0;} .change .bar3 { -webkit-transform: rotate(45deg) translate(-8px, -8px) ; transform: rotate(45deg) translate(-8px, -8px) ; } </style> </head> <body> <div class="container" onclick="myFunction(this)"> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> </div> <div id="mob-menu"> Accordion menu goes here </div> <script> function myFunction() { var x = document.getElementById('mob-menu'); if (x.style.display === 'none') { x.style.display = 'block'; } else { x.style.display = 'none'; } } </script> <script> function myFunction(x) { x.classList.toggle("change"); } </script> </body>
  16. Hello, I have a question about how to send form data to the database, without reloading the entire page. I discovered working with xmlhttprequest. I managed to show text from another file by implementing a javascript function with xhr into my script. I don’t know much about javascript and don’t understand how a javascript form should be added to an existing function. Finally this should run a php script executing the code to add the form data to the database. <!DOCTYPE html> <html> <body bgcolor="grey"> <center> <br><br><br> <div style="height: 200px; width: 600px; border: solid 2px blue;"> <div id="kn_ze"> <form id="my_form" action=""> Give your name: <input type="text" name="fname"> <br> <input type="submit" value="Send" onclick="loadXMLDoc();"> <!-- <button type="button" onclick="loadXMLDoc()">send it</button> --> </form> </div> </div> <script> function loadXMLDoc() { /* document.getElementById("my_form").submit();*/ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("kn_ze").innerHTML = this.responseText; } }; xhttp.open("GET", "prophp.php", true); xhttp.send(); } </script> </body> </html> test script to process the form data prophp.php : <?php echo '<br>test code here : '; if (isset($_POST['fname'])) { var_dump($_POST['fname']); // execute mysql queries } ?> 11) How are the form data placed in the existing function? (or should I create a second one? ) Maybe someone can help me out solving it.
  17. Greetings to all in the forum. I'm totally new to AppML which by the way i found very interesting. Followed the tutorial of https://www.w3schools.com/appml/appml_client.asp till the end of it https://www.w3schools.com/appml/appml_database.asp and trying to build the web application by using WebSQL. In the table customers i can delete an existing record and modified it, but i can't add a new one. Every time when i go to New button and adding new customer data, when i press Save button i got an error in Chrome console Uncaught TypeError: Cannot read property 'CustomerID' of undefined at AppML.putRecord (appml.js:527) at AppML.saveRecord (appml.js:593) at HTMLButtonElement.onclick (app2.html:1) Specifically got error in line 527 of appml.js { if (action === "UPDATE") { if (this.data.records[0][this.data.keyField] === "") {action = "ADD"; } } And in line 593 of appml.js this.saveRecord = function () { this.putRecord("UPDATE"); }; My HTML Prototype is the follow <!DOCTYPE html> <html lang="en-US"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Untitled 1</title> <title>Customers</title> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <script src="appml.js"></script> <script src="https://www.w3schools.com/appml/2.0.3/appml_sql.js"></script> </head> <body> <div class="w3-container"> <div id="Form01" class="w3-container w3-light-grey w3-padding-large w3-margin-bottom" appml-data="local?model=model_customersform" appml-controller="myFormController" style="display:none;"> <div appml-include-html="inc_formcommands.htm"></div> <p> <label for="customername">Customer:</label> <input id="customername" class="w3-input w3-border"> </p> <p> <label for="address">Address:</label> <input id="address" class="w3-input w3-border"> </p> <p> <label for="city">City:</label> <input id="city" class="w3-input w3-border"> </p> <p> <label for="postalcode">Postal Code:</label> <input id="postalcode" class="w3-input w3-border"> </p> <p> <label for="country">Country:</label> <input id="country" class="w3-input w3-border"> </p> </div> <div appml-data="local?model=model_customerslist"> <h1>Customers</h1> <div appml-include-html="inc_listcommands.htm"></div> <div appml-include-html="inc_filter.htm"></div> <table class="w3-table-all"> <tr> <th></th> <th>Customer</th> <th>City</th> <th>Country</th> </tr> <tr appml-repeat="records"> <td style="cursor:pointer;width:34px;" onclick="appml('Form01').run({{CustomerID}})">&#9998;</td> <td>{{CustomerName}}</td> <td>{{City}}</td> <td>{{Country}}</td> </tr> </table> </div> </div> <script> function myFormController($appml) { if ($appml.message == "ready") {return -1;} if ($appml.message == "loaded") { document.getElementById("Form01").style.display=""; } } </script> </body> </html> Any help it's appreciated, i'm stuck at that point. I've tried some solutions but didn't worked. I have a feeling that something i am missing, cause i'm not an english native speaker. Any solutions? Thanks in advance.
  18. Please Provide me Book or Link which Cover the Following Topics: 1. HTML/HTML5 a. HTML Page design using DIV based layout (no tables) b. META Tags c. Viewport d. HTML5 Page design using &lt;header>, <footer>, <article>, <section> and <div> 2. CSS a. Styling of elements using CSS <b>b. CSS properties – float, align, background, margin, padding, position, width, height c. Pseudo classes d. How to override CSS properties</b> e. Inline, embedded and external CSS <b>3. JavaScript a. DOM Manipulation i. Change content of the DIV based on some event ii. Populate data inside a DIV using AJAX iii. Show/Hide Elements b. Event handlers c. Timer functions – setTimeOut, setTimeInterval d. AJAX and JSON e. Cookies management f. Debugging using Browser Console g. JavaScript/CSS magnification </b> Please advise me any link for the topics of above links, or are there any software houses in Dubai who suggest me with the respective resolution. Please reply asap.
  19. I've inserted a clickable dropdown on my site. In FireFox and Chrome, the menu closes when you click outside the menu. This does not work with Internet Explorer. I have taken this code from w3school.com (the same problem on the page): https://www.w3schools.com/howto/howto_js_dropdown.asp What can I do to make it work on the Internet Expolorer the same as in FireFox and Chrome? Thanks for your help.
  20. node

    What About Adding Node.js As Another Tutorial In The Server-Side Languages? to complete the chain of JavaScript and to teach the newer, modern and the attractive part of the language...why not? I am not recommending specific framework W3SCHOOLS can choice any of the available, but please the best! WHY ADDING: I am not here to explain the power of Node.js...Please Google this WHY IT'S NECESSARY: Large companies are using and coming to Node e.g...[Google this also ], and large apps are written with it[Do Not Forget Our friend..Google]. not only it's "Popular", but also fast(because of the non-blocking I/O, being V8 based and more[Google!!!]) THANKS FOR: ADDING NODE AS THE THIRD LANGUAGE
  21. Hi, just wondering if anyone can help me, im trying to display my table above the statisics of the users input, but all it seems to do is split the table. Not sure what im doing if anyone can give me some insight that would be great, thank you. <!DOCTYPE html> <html> <body> <p>GPA CALCULATOR</p> </br> <p>Course Code - Grade Value</p> <p>Statistics</p> <script> //List of Course Code for Validation var coursecode =["ACC1101","ACC3118","ACC5202","ACC5213","ACC5216","ACC5502","ACC8000","ACC8003","ACC8105","AGR2302","AGR3303","AGR3304","AGR3305","AGR4305","ANT1001","ANT2005","ANT2008","ANT3006","BCA3000","BCA4000","BCA8003","BIO1101","BIO1103","BIO1104","BIO1203","BIO1810","BIO2106","BIO2107","BIO2108","BIO2118","BIO2119","BIO3101","BIO3102","BIO3107","CDS1000","CHE1110","CIS1000","CIS2000","CIS2002","CIS3001","CIS3002","CIS3003","CIS3008","CIS5100","CIS5200","CIS5302","CIS5308","CIS8000","CIS8004","CIS8008","CIS8009","CIS8100","CIS8501","CIV1500","CIV2605","CIV2701","CIV3505","CIV3506","CIV3906","CIV4508","CIV5705","CLI1110","CLI3301","CMS1000","CMS1010","CMS1100","CMS2017","CMS2019","CSC1401","CSC1402","CSC2402","CSC2408","CSC3400","CSC3403","CSC3407","CSC3412","CSC3420","CSC3600","CSC8004","CSC8407","CSC8416","CSC8419","CSC8422","CSC8500","CSC8503","CSC8507","CSC8512","CSC8600","CWR1001","CWR2001","DCA9000","DCA9001","DCA9500","DCA9501","EAP7307","EAP7308","ECO1000","EDC1100","EDC1400","EDC2100","EDC2400","EDC3100","EDC4000","EDE2101","EDE3103","EDG3000","EDG5000","EDH1150","EDH2151","EDH2152","EDH3155","EDM8004","EDP2111","EDP4130","EDP4140","EDP4200","EDR8000","EDR8060","EDR8061","EDS2401","EDS3450","EDS4250","EDS4401","EDX1170","EDX1250","EDX2190","EDX2260","EDX3270","EDX3280","ELE1301","ELE1502","ELE2303","ELE2601","ELE2702","ELE2912","ELE3105","ELE3305","ELE3803","ELE3804","ELE3807","ELE3914","ELE4605","ELE4607","ELE5001","ENG1002","ENG1003","ENG1004","ENG1100","ENG1901","ENG2002","ENG3003","ENG3111","ENG4903","ENG5001","ENG8001","ENG8101","ENG8104","ENG8208","ENG8411","ENG8412","ENL1000","ENL2007","ENL3000","ENM1500","ENM1600","ENM2600","ENS7605","ENV2103","ENV2201","ENV3104","ENV4204","FIN1101","FIN2106","FIN2302","FIN3106","FIN3109","FIN5003","FIN8201","FIN1000","FIN1002","FIN1003","FIN2004","FIN2005","FIN2006","FIN3002","GIS1402","GIS3407","HEA8201","HIS1000","HIS2001","HIS8004","HMT2000","ACC1101","ACC3118","ACC5202","ACC5213","ACC5216","ACC5502","ACC8000","ACC8003","ACC8105","AGR2302","AGR3303","AGR3304","AGR3305","AGR4305","ANT1001","ANT2005","ANT2008","ANT3006","BCA3000","BCA4000","BCA8003","BIO1101","BIO1103","BIO1104","BIO1203","BIO1810","BIO2106","BIO2107","BIO2108","BIO2118","BIO2119","BIO3101","BIO3102","BIO3107","CDS1000","CHE1110","CIS1000","CIS2000","CIS2002","CIS3001","CIS3002","CIS3003","CIS3008","CIS5100","CIS5200","CIS5302","CIS5308","CIS8000","CIS8004","CIS8008","CIS8009","CIS8100","CIS8501","CIV1500","CIV2605","CIV2701","CIV3505","CIV3506","CIV3906","CIV4508","CIV5705","CLI1110","CLI3301","CMS1000","CMS1010","CMS1100","CMS2017","CMS2019","CSC1401","CSC1402","CSC2402","CSC2408","CSC3400","CSC3403","CSC3407","CSC3412","CSC3420","CSC3600","CSC8004","CSC8407","CSC8416","CSC8419","CSC8422","CSC8500","CSC8503","CSC8507","CSC8512","CSC8600","CWR1001","CWR2001","DCA9000","DCA9001","DCA9500","DCA9501","EAP7307","EAP7308","ECO1000","EDC1100","EDC1400","EDC2100","EDC2400","EDC3100","EDC4000","EDE2101","EDE3103","EDG3000","EDG5000","EDH1150","EDH2151","EDH2152","EDH3155","EDM8004","EDP2111","EDP4130","EDP4140","EDP4200","EDR8000","EDR8060","EDR8061","EDS2401","EDS3450","EDS4250","EDS4401","EDX1170","EDX1250","EDX2190","EDX2260","EDX3270","EDX3280","ELE1301","ELE1502","ELE2303","ELE2601","ELE2702","ELE2912","ELE3105","ELE3305","ELE3803","ELE3804","ELE3807","ELE3914","ELE4605","ELE4607","ELE5001","ENG1002","ENG1003","ENG1004","ENG1100","ENG1901","ENG2002","ENG3003","ENG3111","ENG4903","ENG5001","ENG8001","ENG8101","ENG8104","ENG8208","ENG8411","ENG8412","ENL1000","ENL2007","ENL3000","ENM1500","ENM1600","ENM2600","ENS7605","ENV2103","ENV2201","ENV3104","ENV4204","FIN1101","FIN2106","FIN2302","FIN3106","FIN3109","FIN5003","FIN8201","FIN1000","FIN1002","FIN1003","FIN2004","FIN2005","FIN2006","FIN3002","GIS1402","GIS3407","HEA8201","HIS1000","HIS2001","HIS8004","HMT2000","HMT4005","INR1000","INR2000","INR3000","INR8010","ISE1000","ISE1001","ISE2001","ISE2002","ISE3000","JRN1010","JRN2000","JRN2001","JRN3003","LAC1001","LAC2001","LAW1101","LAW1111","LAW1112","LAW1113","LAW1114","LAW2211","LAW2212","LAW2213","LAW3130","LAW3311","LAW3312","LAW3467","LAW3469","LAW3471","LAW3473","LAW5230","LAW8001","LAW8715","MAT1000","MAT1101","MAT1102","MAT2409","MAT3201","MAT8180","MBA8000","MEC1201","MEC2101","MEC2202","MEC2402","MEC2405","MEC2901","MEC2902","MEC3102","MEC3203","MEC3302","MEC4103","MGT1000","MGT1001","MGT2001","MGT2204","MGT3001","MGT3005","MGT5000","MGT8002","MKT1001","MKT1002","MKT2013","MKT2015","MSC8001","MSC8002","MUI1001","MUI1007","MUI1008","MUI2002","MUI2003","MUI2006","MUI2020","MUI3005","MUI3010","MUI4002","NSC2500","NUR1100","NUR1102","NUR2100","NUR2200","NUR2300","NUR2499","NUR2800","NUR3010","POL1000","POL2000","PRL1002","PRL2002","PRL2003","PSY1010","PSY1020","PSY2010","PSY2020","PSY2100","PSY3010","PSY3030","PSY3060","REN1201","REN2200","RSH8000","RSH8001","SCI1001","SCI4405","SES1299","SES2101","SES2102","SES2103","SES2104","SES3101","SES3102","SES3204","SES8003","SES8005","SES8008","SES8299","SOC1000","SPE3005","SPE3009","STA2300","STA2301","STA3300","STA8005","SVY1102","SVY1901","SVY2105","SVY2106","SVY2301","SVY2302","SVY2902","SVY3202","SVY4309","THE1001","THE1021","THE1022","THE2003","THE2006","THE2009","THE2011","THE3011","URP1001","URP2001","URP4002","VSA1002","VSA1004","VSA2000","VSA2002","VSA2004","VSA3004","VSA3021","HMT4005","INR1000","INR2000","INR3000","INR8010","ISE1000","ISE1001","ISE2001","ISE2002","ISE3000","JRN1010","JRN2000","JRN2001","JRN3003","LAC1001","LAC2001","LAW1101","LAW1111","LAW1112","LAW1113","LAW1114","LAW2211","LAW2212","LAW2213","LAW3130","LAW3311","LAW3312","LAW3467","LAW3469","LAW3471","LAW3473","LAW5230","LAW8001","LAW8715","MAT1000","MAT1101","MAT1102","MAT2409","MAT3201","MAT8180","MBA8000","MEC1201","MEC2101","MEC2202","MEC2402","MEC2405","MEC2901","MEC2902","MEC3102","MEC3203","MEC3302","MEC4103","MGT1000","MGT1001","MGT2001","MGT2204","MGT3001","MGT3005","MGT5000","MGT8002","MKT1001","MKT1002","MKT2013","MKT2015","MSC8001","MSC8002","MUI1001","MUI1007","MUI1008","MUI2002","MUI2003","MUI2006","MUI2020","MUI3005","MUI3010","MUI4002","NSC2500","NUR1100","NUR1102","NUR2100","NUR2200","NUR2300","NUR2499","NUR2800","NUR3010","POL1000","POL2000","PRL1002","PRL2002","PRL2003","PSY1010","PSY1020","PSY2010","PSY2020","PSY2100","PSY3010","PSY3030","PSY3060","REN1201","REN2200","RSH8000","RSH8001","SCI1001","SCI4405","SES1299","SES2101","SES2102","SES2103","SES2104","SES3101","SES3102","SES3204","SES8003","SES8005","SES8008","SES8299","SOC1000","SPE3005","SPE3009","STA2300","STA2301","STA3300","STA8005","SVY1102","SVY1901","SVY2105","SVY2106","SVY2301","SVY2302","SVY2902","SVY3202","SVY4309","THE1001","THE1021","THE1022","THE2003","THE2006","THE2009","THE2011","THE3011","URP1001","URP2001","URP4002","VSA1002","VSA1004","VSA2000","VSA2002","VSA2004","VSA3004","VSA3021"]; // Course Code and Grade Value Arrays var courseCodeArray = []; var gradeValueArray = []; // Prompt for User to Enter Their Courses Codes which is then Looped Until a Valid Respond // is Entered var input_coursecode = prompt("Please Enter Your Course Code?", ""); var a = coursecode.indexOf(input_coursecode); while(a == -1) { alert("The Code you Entered is not a Valid Course Code, Please Try Again"); var input_coursecode = prompt("Please Enter Your Course Code?", ""); var a = coursecode.indexOf(input_coursecode); } courseCodeArray.push(input_coursecode); // Prompt for User to Enter Their Grade Value which is then Looped Until a Valid Respond // is Entered var input_gradeValue = parseInt(prompt("Please Enter Your Grade for this Course?", "")); while(input_gradeValue > 7 || input_gradeValue < 1) { alert("The Grade you Entered is Not Valid, Please Try Again!"); var input_gradeValue = parseInt(prompt("Please Enter Your Grade for this Course?", "")); } gradeValueArray.push(input_gradeValue); var askUser = confirm("Would You Like to add Another Course?"); while(askUser == true) { var input_coursecode = prompt("Please Enter Your Course Code?", ""); var a = coursecode.indexOf(input_coursecode); while(a == -1) { alert("The Code you Entered is not a Valid Course Code, Please Try Again"); var input_coursecode = prompt("Please Enter Your Course Code?", ""); var a = coursecode.indexOf(input_coursecode); } courseCodeArray.push(input_coursecode); var input_gradeValue = parseInt(prompt("Please Enter Your Grade for this Course?", "")); while(input_gradeValue > 7 || input_gradeValue < 1) { alert("The Grade you Entered is Not Valid, Please Try Again!"); var input_gradeValue = parseInt(prompt("Please Enter Your Grade for this Course?", "")); } gradeValueArray.push(input_gradeValue); var askUser = confirm("Would You Like to add Another Course?"); } // Table Listing Course Codes Enters and Grades for (var i = 0; i < courseCodeArray.length; i++) { document.writeln('<table border="1">'); document.writeln('<tr>'); document.writeln('<td>'+courseCodeArray+'</td>'); document.writeln('<td>'+gradeValueArray+'</td>'); document.writeln('</tr>'); } // Number of Courses the User has Completed: var lengthofCourseCode = courseCodeArray.length; document.write("Number of courses completed: " + lengthofCourseCode + "</br>"); //Highest Grade Value document.write("Highest Grade Value: " + Math.max.apply(null,gradeValueArray) + "</br>"); //Lowest Grade Value document.write("Lowest Grade Value: " + Math.min.apply(null,gradeValueArray) + "</br>"); //GPA CALCULATOR //GPA Score var sumofGradeValue = 0; for(var i=0, n=gradeValueArray.length; i < n; i++) { sumofGradeValue += gradeValueArray; } var actualGPA = sumofGradeValue/lengthofCourseCode; document.write("GPA : " + actualGPA + "</br>"); </script> </body> </html>
  22. BACKGROUND: I am tempted to write something like the following foreach ($non-matches as $key => $val) { echo '<script> $("#' . $key . '").append("<p style=' . '"color:red;">Complete this item!</p>);</script>)'; } QUESTION ONE: Under the assumption that the echo statement is correct would you recommend this as proper programming procedure? If not, please explain why and provide an alternative, more appropriate strategy that would achieve the same objective suggested by the use of a jQuery object ? QUESTION TWO: If it is proper programming procedure, please correct the echo statement so that it will achieve the following: $("#...").append("<p style='color:red;'>Complete this item!</p>"); EDIT: In order to assist you in your response, the PHP variable $non-matches contains a list of values for the id attributes of form input control tags that have been carefully selected through a prior PHP procedure. An alternative approach that is currently under consideration is to create a JSON object, assign it to a Javascript variable, and iterate the resulting object with jQuery.
  23. I recently used PHP's json_encode( ) function to covert an array created with PHP into a JSON encoded object, as the conversion appeared normal, I then assigned the value to a Javascript variable using PHP's echo construct and reproduced it with a JS alert. This too, appeared normal. My difficulty arose when I tried using the jQuery .map( ) method to convert my nested Javascript object into a nested Javascript array. I received the following error message in my Console: TypeError: e is not an Object. (evaluating 't-1 in e') Am I being foolish to believe that I need a nested array when I already have a nested object? If not, is there not a routine to perform this very conversion?
  24. So, I'm really stuck. I know how to make a quiz just fine, with radio buttons, go to the next page, etc., but for our project we have to make the quiz go from one page to the next and hold the answers provided, and then at the end we need to output the result by combining the answers. Essentially it's a personality quiz type thing, rather than a scoring one. My idea is to add 1 each time an answer corresponding to that personality is given, but how to I transfer those values from one page to the next?
  25. Hi. I am familiar with some HTML but my knowledge in Javascript, JQuery and CSS is very limited. I have been learning from examples on the web and making my own changes. Please see the fiddle I am working on below; sorry if the full code is messy! https://jsfiddle.net/djj2c84t/ There are a number of features I wish to implement but I am totally stumped! I have gotten as far as I think I can with the fiddle above and it would be more than appreciated if anyone can provide any help, possibly with any example code and where the code needs to go. When I make a multiple selection from the list, how do I get the results (divs) to show in order of most recent selection at the top? For example, if I multi-selected in the order Nuts, Meats, Vegetables, Fruits, how do I get the results (divs) to appear in the order Fruits, Vegetables, Meats, Nuts? At the moment they appear in the order that they are listed in the box. I would also like to ask if it is possible to keep the results (divs) showing for all the items selected even after a new search is performed and a new selection made. For example, if I search for 'F' and select 'Fruits' and then search for 'V' and select 'Vegetables', can I have both the 'Vegetables' and 'Fruits' divs showing in the results? At the moment, 'Vegetables' replaces 'Fruits'. If this is possible, would it also be possible to have the selected items in the list remain highlighted even after a new search is performed? For example, after making the above searches/selections, if I then search for 'ts', the list would show 'Fruits', 'Nuts' and 'Meats', but I would like 'Fruits' to still be highlighted and to be able to close the 'Fruits' div by de-selecting 'Fruits' from the list or clicking the Close (X) button on the 'Fruits' div itself. There are a few other things I have not been able to solve but I will refrain from posting too many questions at once. Any help would be greatly appreciated! Thank you.