• grab data-* value from DOm and print unordered list

    I want to loop through all label elements of my page and grab their id and data-myvalue values and  show them as an un-ordered list below the div... How can i achieve this   Example  <div>         <span>     <label id="SA.MC.AMC.Breakfast" data-myvalue ="2"></label>     <label id="SA.MC.AMC.Breakfast.Output" data-myvalue ="4"></label>  </span>     </div> The un-odered list should be like this <ul> <li>SA.MC.AMC.Breakfast  :2 </li> <li>SA.MC.AMC.Breakfast.Output  :4 </li> <ul> Thank you in advance
  • Making textarea draggable in jquery UI

    Just discovered jquery ui library which appears to offer everything I need to develop a web interface for a timetabling application. However it all hinges on being able to drag a textarea. For the moment I just wish to know if it is possible. It is then up to me to get investigating. Thanks 
  • $(event.target) works on click, but not keydown... alternative?

    I have this script working just fine when I click on it using the mouse, but it doesn't trigger the while() loop if I move to it using arrows:  $('[data-ce]')       .on('keydown click', function(e) {             var node = $(e.target);             while (node.is('contenteditable') !== 'true') { alert('node - ' + node[0].nodeName); alert('this - ' + this.nodeName);                   if (node[0].nodeName == 'B' && !$('[data-richcont="B"]').hasClass('richbuttonOn'))                         $('[data-richcont="B"]').removeClass('richbuttonOff').addClass('richbuttonOn');
  • How come the other answer won't display upon alert? The only thing that displays is "not quite try again". PLEASE HELP

    <p>What was the name of the book featured in the firsrt episode of the first season?</p> <form><p><input type="text" id="guess"> </p></form> <p><button id="checkGuess">Guess!</button></p> <script> $("#checkGuess").click(function() { var AnswerEntered = $("#checkGuess").val(); var guess = "The Last Man Alive"; if ($(AnswerEntered) == guess) { alert("You got it, your a fan!"); } else { alert("Not Quite, try again"); } }); </script>
  • jQuery addClass to all img

    Hi. I'm having some issue on FAQ page. The basic FAQ is the dropdown image doesn't have any class or id. We want when user click the question it toggle open and i'm using jQuery to add some class on the image. But the issue is it add the class on all the image question, not only current toggle question. How can i achieve this? Can someone guide me. Here is the script that i'm working for. {source} <script type="text/javascript">     jQuery(document).ready(function(){     jQuery("a").click(function(){
  • How to read a text box value and copy it to another one?

    Hi, I have a List View and above it, there is a filter... The filter is any text entered by the user... How can I copy the value the user enters in that box and copy it to a another box? The background is I;m using K2, we have a listview, above it is a Built-in feature to filter results, we want to capture what the use types in that filter and then use the value to trigger a report using that filter value. At the moment, we can't do anything with that filter value, so hoping jquery can somehow copy
  • Put <td> below <th> having similar values

    Hi folks, Actually I have a table organized in this way : CompanyName | Red | Blue | Yellow company1 Blue Yellow Red And I would like to dynamically put similar elements bellow <th> having the same value CompanyName | Red | Blue | Yellow company1 Red Blue Yellow Many thanks for any help in these regards. Below is my try.. but doesn't seem to be successful var headers = []; var row = []; $("#dashboard > thead > tr > th").each(function(k,v){ var header = cleanHeader($(this).text()); $("#dashboard >
  • How can i repeat a SVG animation with Jquery ?

    Hi, How can i repeat a svg animation with jquery loop ? So that each time i can give different color to the draw line. Below is my code. This is the fiddle, https://jsfiddle.net/Lsau2h4t/2/ The aim is i want to draw the line with different colors each time one color, Eg: First red, Second repeat green, third repeat yellow etc.. How can i do it ? Thanks in advance.
  • Getting error while creating InputTextArea on button click using jQuery in jsf

    Hi All, I want to create InputTextArea dynamically on button click. While doing so, getting the following error. Code: <h:head>             <f:facet name="first">                 <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>                 <title>TxtArea Dynamic</title>             </f:facet>             <h:outputScript library="primefaces" name="jquery/jquery.js"/>             <script type="text/javascript" src="jquery-1.3.2.min.js"></script>              <script type="text/javascript">
  • can jquery support a menu sending files to 3 different DIVs on the same page

    I am trying to update from frames to flexbox.  Now i am trying to use jquery.  I have succesfully been able to load  the menu from the first div into the second.  But sending files from the second div to load into the third nothing I try works. The first div holds a master menu. the second holds a submenu.  The thrid div is for viewing files.  Id like to actually have a fourth DIV  for viewing files as well.  This is a large educational tool I build in frames.  With the target command I have no problem
  • Is it faster to use .hasClass() before removing classes, or just go ahead and remove it?

    I'm not quite sure how to test this for myself, but I'm thinking this might be a rookie question, anyway. Is it generally faster to test if an element has a class assigned to it before removing it? Or is that just doubling down on the processing time whether it's true or false, in which case it would be faster to just remove it without testing? if ($('[data-richcont]').hasClass('on'))       $('[data-richcont]').removeClass('on'); And does the same stay true if I use removeClass('on').addClass('off')?
  • Add google tag manager with jquery on the head of html document

    First of all thanks for letting me be a part of this forum.  I need to place google tag manager with jquery on a webpage, but I'm new to jquery world and after several trials without success I decided to come here to may get some help. Sorry about my English, I'm still learning.
  • Reorder numbers in string

    I have a string with numbers: 10 9 8 11 I need to reorder them so they are in order like this: 8 9 10 11 So I'm using this function: strToAppend = strToAppend.split(' ');                 strToAppend.sort(function (a, b) {                     if (isNaN(a) || isNaN(b)) {                         return a > b ? 1 : -1;                     }                     return a - b;                 }); That works but the problem is that the string comes out like this: 891011 How can I reorder and still keep the
  • Found out selected tab

    I'm using tabs like this: https://jqueryui.com/tabs/ I need to perform different tasks depending on which tab is selected. How can I check which one is selected?
  • Best way to concatenate two URL parameters into one hidden field

    How can I concatenate two URL parameters into one hidden field? For example: sometestingurl.com?color=yellow&thingy=box We'd like "yellow-box" to pass in the hidden field, "finalProd".     $('a[href^="http"]').each(function() {         var $a = $(this),             q = $a.attr('href') ? $a.attr('href').indexOf('?') : -1,             contents = $a.html();         if (q == -1) {             $a.attr('href', $a.attr('href') + '?color=' + App.getParameterByName('color') + '&thingy=' + App.getParameterByName('thingy'));
  • Diff between jquery.js and core.j

    Hi, I have recently downloaded jquery using npm. I got dist folder with core.js and jquery.js (plus ui and maps). I initially want to use just basic - which one do I need core.js or jquery.js or both? Regards, Janusz
  • adding a hash to URL in order to access unique content in the page

    I have a page build with products that when clicked a panel above shows a content related to the product. this is my sloppy code to accomplish it $(document).ready(function(){     $( ".tab-1-th" ).on( "click", function() {       $('.hdr-tab').hide().removeClass("active in");       $('#tabs-1').fadeIn();   });   $( ".tab-2-th" ).on( "click", function() {       $('.hdr-tab').hide().removeClass("active in");       $('#tabs-2').fadeIn();   });   $( ".tab-3-th" ).on( "click", function() {       $('.hdr-tab').hide().removeClass("active
  • How to pass URL parameter to form submission

    What's the best way to pass a URL parameter to a form submission? For example, in the following URL, we'd like to pass 'cid' and 'eid': domainname.com?cid=12623&eid=fwa3
  • Can i download a local version from the past release?

    Hi, can i download and use on my commercial website the past version of jQuery/jQuery UI form https://code.jquery.com? Or i must use it just as CDN? Thanks
  • How can I translate the page horizontally left using translate3d and jQuery?

    Sideways scrolling seems to be the in thing now, but I do not see much advice on translating the page using translate3d.  Ideally, I'd love to be able to translate the page left, on 'Scroll', but I am having trouble with my maths. A few articles said I can use pageXOffset for compatibility, but as I say, I am unsure on how to calculate my maths. Do I have to calculate the width of all items first '#feature--items'? Then translate '-' + x + 'px' based on that?  So far (along with CSS) I have this: 
  • UI Demo "Droppable"

    Hi I am new here and I have absolutly no experiance with coding or java. But I use "Hype" from Tumult without coding. Now I want to iport the UI Demo "Droppable". But I don't need the squares, I need different pictures. How can I change the code to replace the squares with jpgs? Thanks a lot for helping!
  • Does the php interpreter get confused when there's a defined FORM submitted to x.php, but also an Ajax call to y.php?

    Hi, I'm working with some code that has a standard FORM and Submit button, with the associated x.php to process the fields. But there's also Javascript that refers to a certain section on that form, but which has an Ajax() $_POST call to another url y.php. Is that proper?  Since this is essentially a Submit (I think) to one form inside another form with a different submit module, is that considered a nested form?   I don't even know if nested forms are ok in php, to begin with, aside from the javascript.
  • Reorder list elements (by code, not mouse)

    I have a list with values and the order from start is a bit random and differs from time to time: <ul>       <li>2</li>       <li>10</li>       <li>5</li>       <li>7</li>       <li>6</li>       <li>8</li>       <li>9</li>       <li>4</li>       <li>1</li>       <li>3</li> </ul> How do I reorder the list so that 1, 3, 6 and 7 always ends up first? Also the order of the rest of the elements needs to be preserved. So the result would be: <ul>    <li>1</li>    <li>3</li>    <li>6</li>    <li>7</li>
  • Access and hide column only for outer table

    I have an outer table and want to hide second column, but not for the inner tables. $('.table-main td:nth-child(2)').hide(); The problem here is that all the inner tables second columns hides as well. So how can I just hide the outer table called table-main and not all the tables within?
  • Pricing slider and bootstrap

    Hi community, I'm trying to implement a pricing slider where the price is incremental with the number of the slider (i.e. 10 is 200€, 11 is 220€, 12 is 240€...40 is 790€ and so on), and it also needs to be displayed in three different currencies ($,€ and £). This is my first attempt ( https://jsfiddle.net/5vyao3qe/ ) but as you can see the number of the slider is the same than the pricing. Can someone point me in the right direction? Thanks!
  • json dynamic table sorting

    Hi all I was able to create a table out of json file. now i like to add sort when i click on table header. is there a  way to do it? please guide me. Thanks kristtee
  • How to get x-template from html file

    Hi: I meet a problem about how to get the x-template from html file. the following is my x-template code snippet    <script type="text/x-template" id="TableTemplate">             <thead>                 <tr>                     <th width="250px">Model</th>                     <th width="250px">Name</th>                     <th width="70px">Share</th>                     <th width="150px">Price Range</th>                     <th width="150px">Brand</th>                     <th width="100px">Options</th>
  • How to get code to stop in hover function when .mole reaches top (0%) and go to game_over()

    <html>     <head>         <style>             body{                 background-color: #facb56;                 height:100%;                 width:100%;                 overflow:hidden;             }                         .mole{                 background-color:rgb(128,64,0);                 border-radius:100px 100px 0px 0px;                 height:100%;                 width:10%;                 position:absolute;                 top:100%;                 background-image: url('mole.png');                
  • Dynamically create button and then remove button when clicked

    Hi, I am a newbie and new to this forum so I hope I dont contravene or breach any protocols. I have divs in html and when I click the div I am adding a button.  eg attached: <div class="week"> <div class="day wk1" id="day1"> <label for="day1">Test</label> </div> <div class="day wk1" id="day2"> <label for="day2">Test</label> </div> When I add a button by clicking on the div, no problem. $(".day").click(function (e) { e.preventDefault(); var check = $("#day7").width() - 2; var insert = $(this).prop("id");
  • how I pass a variable to selector

    I'm using  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> and I wani to pass a variable at selector $('.cell'+i).each(function(){         var get_val = $(this).val()         sum1 += parseFloat(get_val);
  • Why I am not able to get the individual row?

    Hi, I have a retured row from my database like this: [{"result":"1","0":"1"}] using: }).done(function(data) {     console.log("data: " + data);     console.log("data[0].result: " + data[0].result);     console.log("data.result: " + data.result); but why my data[0].result or data.result shows undefined? then how can i get the field result? Thanks, Jassim
  • Strange Responses

    Hi:    Adapted from http://jsfiddle.net/supercool/550nq015/     using  <script src="https://code.jquery.com/jquery-1.8.3.js"></script> Code: When I run this from website it fails and the source of the page shows this code bloc as below <script type="text/javascript">        $("#tenantTable tbody tr").live('click', function (event)     {             $(".selected").removeClass('selected');             $(this).addClass('selected');     }); </script> ---------------------------------------------- From
  • Unexpected token w in JSON at position 18

    Hi, I've been at this for a day and a half, trying different permutations and code off the web.  No matter what is inserted, I keep getting an Unexpected token error.  This time, it's token w at position 18. I've simplified the code considerably:                         var data = { "sssss" : "ttttt" };                         // data = jQuery.parseJSON(JSON.stringify(data));                                                  // alert( data ) ;                         $.ajax({                      
  • Just need some help

    I would like to know what is wrong and why is the toggle action not working?  <div id="dropdown-1" class="dropdown dropdown-processed"> <div id="free-evaluation" class="container gray-row" style="background-color: #e6e6e6;"> <div class="wrapper wk-row"> <div class="wk-col-2 text-center"> <span class="wk-icon-filled-wrench" style="font-size: 5.5rem;padding-top:20px"></span> </div> <div class="wk-col-10"> <h3>Expert Service – We understand the needs of Your Trust Tax Department</h3>         <p>Our
  • Cannot read property 'nodeName' of undefined at Tab._activate (bootstrap.js:3687)

    I have a multi-step form that has "Next" and "Go back" buttons in each step. But every time a "Next" or "GO back" button is clicked on  the console appears "     Uncaught TypeError: Cannot read property 'nodeName' of undefined         at Tab._activate (bootstrap.js:3687) ". Do you know what can be the issue? I have a fiddle with the example but in the fiddle the buttons no navigate between the form steps are not working don't know why. Example: https://jsfiddle.net/7r1tg863/4/
  • Single quote array for typeahead

    item.php // Get Catalog $item = new Item($pdo); $item_list = $item->get_items(); echo json_encode($item_list); typeahead-data.js var items = ['Item One', 'Item Two', 'Item Million']; How do I use the data from jQuery to populate the items instead of hard coding? $.getJSON('item.php', function (items) { var typeahead_items = ????; });
  • Need to pull aria-label attribute into styled dropdown menu script

    I have a custom jQuery script that is a sort of lightweight version of chosen.js. The script works perfectly fine, but for ADA compliance I need to be able to detect if an aria-label is present, and pass it into the function. JS isn't my strongest language so I'm scratching my head a bit as to how to achieve this. Could anyone assist in pointing me in the right direction? Thank you! My code so far...   ( function( $, window, document, undefined ) {     "use strict";     var pluginName = "customSelect",
  • JQuery context menu in HTML/js code

    Hi, I have an application with some HTML/js code. I am using jquery to show a contextmenu (Version: 1.6.6) in the $document element when I rightclick in a div of this document. With 'autohide' it closes when mouse leaves the HTML document, but I would like to close the context menu in some other situations. This is my first problem, how to close the menu programatically... My code:    $(document).contextMenu({           selector: '#' + panelId,           autoHide: true,           items: ...      
  • auto filter and autocomplete

    Hi ,   I need to filter per country first through dropdown select by country, then autosuggest/autocomplete on  the input textbox the companies under the countries selected.  My question is  : How do I pass the variable from dropdown?  Here are by codes below : 1st page (index) //dropdown    <select name="f_country_id" class="form-control" id="f_country_id">    <option value="?cid=0&code=0" >-- Select Country --</option> <?php while($country = $sql_getCountries->fetch_assoc()){ echo '<option '; if($country['id']
  • Post to admins

    Hi learners and admins. There's a big problem jquery's with css. I'll share code and I want to run the code yourself. you'll see the problem.        CSS .box .bio { position: absolute; top: 400px; left: 20px; text-decoration: none; color: #fff; padding: 10px 15px; border:1px solid #fff; background-color: rgba(250,250,250, 0.3); box-shadow: 0 0 4px rgba(0,0,0, 0.5); border-radius: 5px; transition: all 0.2s ease-in-out; display: none; } .box .bio:hover { background-color: transparent; }      HTML <div
  • Next Page

  • Announcements

  • The Basics of jQuery AJAX

    A step-by-step tutorial for those new to jQuery and wanting to use AJAX in their projects. Includes valuable information about troubleshooting using the console and understanding the request / response. http://jayblanchard.net/basics_of_jquery_ajax.html
  • jQuery Conference 2010: Boston Announcement

      The jQuery Project is very excited to announce the jQuery Conference 2010: Boston on October 16-17, 2010.  The conference will be held at the Hilton Boston Logan in Boston, Massachusetts.  The best part of this announcement is that Tickets are on sale now!  This venue is the largest that the project has worked with to date (Harvard Law School in ‘07, the MIT Stata Center in ‘08 and Microsoft New England Research Center in ‘09) and we expect to sell out very quickly. A brief synopsis of some of