[Solved] Reducing object to simple array

Solution 1 var obj= { 0: “United States”, 1: “India”, 2: “Germany”, 3: “Brazil”, 4: “Taiwan”, 5: “Israel”, 6: “United Kingdom” } var result = Object.values(obj) console.log(result); Solution 2 var result = Object.keys(obj).map(function(key) { return obj[key]; }); console.log(result); 1 solved Reducing object to simple array

[Solved] JQuery issue with a back to top function

You should edit your CSS to hide your “Back to Top” button by default, and then show it when the show class is added. #toTop { display: none; background-color: #FF9800; width: 50px; height: 50px; text-align: center; border-radius: 4px; margin: 30px; position: fixed; bottom: 30px; right: 30px; transition: background-color .3s; z-index: 1000; } #toTop.show { display: … Read more

[Solved] not working js script

put all in document ready handler and see if helps: <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js”></script> <script type=”text/javascript”> jQuery(function($){ var prev = ”; $(‘#zzz img’).click(function(){ if (prev != ”) $(‘#img_’ + prev).css(‘border’, ‘1px solid #eee’); prev = $(this).attr(‘id’).replace(‘img_’, ”); $(this).css(‘border’, ‘1px solid #535666’); $(‘#imgid’).val(prev); }); }); </script> Hoping that you are having jQuery plugin loaded before this script. solved … Read more

[Solved] Ampersand in innerHtml() not being read correctly and validating in JS

.innerHTML isn’t a method. For jQuery, it’s $(this).html() or with the native API, it would be this.innerHTML. And use more sensible flow control constructs like a switch statement. Generally, .innerHTML comparison can be touchy. Use .text() instead when you’re only comparing the text content. $(“li.menu-item a.ui-link”).each(function() { switch ($(this).text()) { case “Accounts”: $(this).addClass(“AccountIcon”); break; case … Read more

[Solved] Need to display forms as per the checkboxes selected [closed]

If you want the solution in JQuery, here you go: $(“.formGroup”).hide(); $(‘#chooseForm input:checkbox’).on(‘change’, function() { if($(this).is(‘:checked’)) { $(“#” + $(this).val()).show(); } else { $(“#” + $(this).val()).hide(); } }); ​ A complete example: http://jsfiddle.net/exttq/ Hope it helps! 2 solved Need to display forms as per the checkboxes selected [closed]

[Solved] JQuery .focus() not work in .blur() event in Firefox

$(“#txtfname”).focus(function () { //Check if value is blank or not if ($(“#txtfname”).val() === “” && $(“#txtfname”).val().length >= 2) { $(“#fnamemsg”).hide(); // Hide message } }); var element = document.getElementById(‘txtfname’); element.focus(); element.onblur = function () { if (element.value !== “” && element.value.length < 2) { $(“#fnamemsg”).show(); $(“#fnamemsg”).html(“* Firstname required 2 character”); setTimeout(function () { element.focus(); }, … Read more

[Solved] Find and parse url in dom-element value using RegExp and jQuery [closed]

Try: var value = $(“param[name=”movie”]”).val();//get attribyte value if(value && (value = value.match(/secEncCode=(\w+)/))){//reg exp value = value[1];//get first pocket console.log(value);//res } http://jsfiddle.net/xbQxw/ update by comment If you want change secEncCode value: var param = $(“param[name=”movie”]”),//get obj value=param.val(),//get attribyte value key; if(value && (key = value.match(/secEncCode=(\w+)/))){//reg exp key = key[1];//get first pocket param.val(value.replace(key, “YOUR NEW KEY”));//replace key … Read more

[Solved] Shining Image jquery plugin not work

You said you have a reference to it so this is probably the issue: You are referencing the JQuery scripts again in the page, thus overriding the Shining Image plugin which declared before the second reference. JQuery plugins extends the JQuery object, So if you reference JQuery again it overrides the “extended” JQuery object. Check … Read more

[Solved] PLEASE assist me.. RE: *FORM FIELDS* I want to Hide() my “type=text box” until the Other option is chosen in the dropdown option

Two main issues with your original code: 1- Using a wrong selector for the onchange event, replace “Other” by “#title” 2- You were checking if the value is equal to “Other” instead of the “other” you have in your HTML. Be careful, string comparison is case-sensitive! Below is a working snippet after applying these two … Read more