javascript - Change background color when aria-valuenow="off" -


i have following code:

<a class="ui-slider-handle ui-slider-handle-snapping ui-btn ui-shadow" aria-valuenow="off" style="left:0%"> 

i want change background color when aria-valuenow="on" or style="left:100%". possible?

try adding following wherever you're triggering changing aria-value:

if($('.ui-slider').attr('aria-valuenow')=="on"){   $(body).css("background-color","red"); } else {   $(body).css("background-color","none"); } 

i'd recommend using true , false rather on , off standard practice. should allow instead:

if($('.ui-slider').attr('aria-valuenow')){   $(body).css("background-color","red"); } else {   $(body).css("background-color","none"); } 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -