[Solved] Search box placehoder text should change when an option is selected from a drop down list

You need to attach a change event to the select box. In it you grab the text from the selected option and set the placeholder attribute on the search box. var select_designatfirst = $(‘#select_designatfirst’), empSearch = $(‘#empSearch’); select_designatfirst.on(‘change’, function () { empSearch.attr(‘placeholder’, ‘Search ‘ + select_designatfirst.find(‘:selected’).text()); }); jsFiddle example That said, unless the search box … Read more

[Solved] JQuery files NOT working

You should download a copy for your local machine and use a newer version. Then you can create a fallback to your jQuery source: <head> <meta charset=”utf-8″> <title>Super Mario!</title> <link rel=”stylesheet” type=”text/css” href=”https://stackoverflow.com/questions/29851424/css.css”/> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js”></script> <script type=”text/javascript”> if (typeof jQuery == ‘undefined’) { document.write(unescape(“%3Cscript src=”path/to/jquery-1.11.2.min.js” type=”text/javascript”%3E%3C/script%3E”)); } </script> <script type=”text/javascript” src=”script.js”></script> </head> If the … Read more

[Solved] Creating checkboxes which include images [closed]

http://jsfiddle.net/pwoojpv1/ HTML <div class=”check-img” style=”width:100px;height:100px;”> <img src=”http://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Tux.svg/883px-Tux.svg.png” > <div class=”check”>&check;</div> </div> CSS *{ box-sizing:border-box; } .check-img{ position:relative; top:0px; left:0px; } .check-img img{ border:solid 2px gray; width:100%; height:100%; cursor:pointer; } .check{ padding-left:5px; color:grey; height:20px; width:20px; background:grey; position:absolute; bottom:0px; right:0px; } .check-img.checked img{ border-color:orange; } .check-img.checked .check{ background:orange; color:white; } JS $(document).ready(function(){ $(“.check-img”).click(function(){ $(this).toggleClass(“checked”); }); }); 2 … Read more

[Solved] How to exam wise countdown timer start [closed]

Like I said in another thread, you need to remove the countdown from the LocalStorage. To achieve this you need to perform this action on an defined event, like a button click, or whatever. function resetCountdownInLocalStorage(){ localStorage.removeItem(“seconds”); } You can call this action, like I mentioned on for example the click event of your “Next” … Read more

[Solved] How can I set data-* attributes on the button when the AJAX requests complete?

Use jquery data instead: $(“#submitForm”).data(‘transaction’, transactionID); And var number_id = $(“#submitForm”).data(‘transaction’); Notice that this will not add the attribute to the DOM, if you inspect the element via the developers tool, you won’t see data-transaction, but the element will have the data referenced. Edit: Your method should also work, but as @Tushar pointed out, you … Read more

[Solved] Onclick “li” enable and disable

You just need to do: $(‘li.something’).unbind(‘click’); // to disable To enable you need to rebind the function $(‘li.something’).bind(‘click’, function() { … I don’t know what you want to do, but if you actually want to unbind/bind the event like an (on/off) then you should store the function and just pass it in the bind. Like: … Read more

[Solved] split string with number using jquery [closed]

You could split by whitespace if exists and take a positive lookahead for number/s and closing parenthesis. var string = “1)test one 2)test two 3)test three 4)test four 5)test five”; console.log(string.split(/\s*(?=\d+\))/)); 0 solved split string with number using jquery [closed]

[Solved] How to make a text carousel with JQuery?

You’re missing a crucial part: jQuery. Add this: <script src=”https://code.jquery.com/jquery-3.1.1.js”></script> Also, if you download it directly, you’ll still be missing several items. In their code, they call their scripts in this fashion: <script src=”https://stackoverflow.com/js/odometer.min.js”></script>. You have to modify it for your own use: <script src=”https://aethex.xyz/js/odometer.min.js”></script> Add the https://aethex.xyz/js/odometer.min.js to every script, and it should work … Read more

[Solved] How to combine 3 images in html/javascript

You could use something like this if you wanted something in pure CSS. It’s a very rudimentary example but should get you started. It uses CSS clip-path on the image elements and transition to modify the clipping on hover. #img-wrap { width: 300px; height: 300px; position: relative; } #img-wrap img { clip-path: inset(0 66% 0 … Read more

[Solved] add link to each image with jquery [closed]

This should do as you want: $(“div .copy-url”).each(function() { var imgval = $(this).find(‘.copy-url’).val(); var sharer = “<a class=”share” href=””+imgval+””>share</a>”; $(this).append(sharer) }); You had the following mistakes: You had mismatching quotes in “<a class=”share”>” should be “<a class=”share”>” In the line $(‘.copy-url’).val you are missing $(this).find and () after your .val. Should be $(this).find(‘.copy-url’).val() You have … Read more

[Solved] I want to encrypt blob using SHA in javascript

This is not possible. SHA is a cryptographic hash function, not an encryption function – the result is not reversible. See Fundamental difference between Hashing and Encryption algorithms for an in-depth explanation. Now, to really encrypt data in JavaScript (say with AES), there are several options. Since it is hard to get cryptography and key … Read more