Category : jquery

When I run the below JS only P elements with hello in it will appear except the first one, why won’t the first one show up? queryResult = 1; function testQuery() { queryResult = "hello"; if (queryResult == "") { return false; } $("p").css("display", "none"); var headings = document.evaluate("//p[contains(., ‘" + queryResult + "’)]", document, ..

Read more

I am beginner at javascript How to create a function who activates 4 toggles as soon as the page loads ? Thk a lot My toggles: <div align="center"> <button id="togg1" name="load_en_cours" id="load_en_cours" style="background-color:#3DA1EA">En cours</button> <button id="togg2" name="load_mon_equipe" id="load_mon_equipe" style="background-color:#6B00A4">Mon Equipe</button> <button id="togg3" name="load_archives" id="load_archives" style="background-color:#FF8B00">Archives</button> <button id="togg4" name="load_performance" id="load_performance" style="background-color:#01B82D">Performance</button> </div> For example, what toggle ..

Read more

$("#paragraph").on("click", function(event){$("#paragraph").append(‘ Whoah! I didnt even know I could do that! I am a RAINBOW!’) event.preventDefault();}) I tried adding event.preventDefault() simply because I know that has to do with actions being permanent in some way or another. I honestly have no idea what it does. My problem is I want the text to only be ..

Read more

using the filter function with the following code: tabs = [‘GP_0_Result_’, ‘GP_Scores’, ‘LGP_Scores’]; gp = []; gp[0] = new Object(); gp[0].round = []; gp[0].round[0] = new Object(); // gp[0].round[0].activeTabs = [‘GP_0_Result_’, ‘SGP_Scores’, ‘BBC’]; gp[0].round[0].activeTabs = []; $fn_removeTabs = function($fn_rebuildTabs){ gp[0].round[0].activeTabs = gp[0].round[0].activeTabs.filter(function(val, i){ a = (tabs.indexOf(val.substring(0,16)) == -1 ? true : false); return a; }); ..

Read more