javascript - Make Text visible on grey rows in a table? -


we have html code radio buttons in table:

<div class="graytitle">wie oft nutzen sie whatsapp?</div> <ul class="pageitem">     <li class="radiobutton"><span class="name">sehr oft</span>     <input name="frage10" type="radio" value="sehr oft" /></li>     <li class="radiobutton"><span class="name">mittelmäßig</span>     <input name="frage10" type="radio" value="mittel" /></li>     <li class="radiobutton"><span class="name">ehr selten</span>     <input name="frage10" type="radio" value="ehr selten" /></li> </ul> 

we want grey out rows without making text invisible, have googled lot couldn't find solution. used:

for (var = 0; < document.umfrageform.frage10.length; i++) { document.umfrageform.frage10[i].style.backgroundcolor = "gray"; } 

it greys out rows, including text. want text still visible after making rows grey. how can that?

disaster screenshot:

enter image description here

based on jsfiddle: stylesheet positioning span tags behind input tags, that's why don't see span remove input transparency.

what need apply background color span tags, not input tags.

[update] @alicelieutier mentioned in comments, if need support recent browsers choose apply semi-transparent background input:

for (var = 0; < document.umfrageform.frage10.length; i++) {   document.umfrageform.frage10[i].style.backgroundcolor = "rgba(0,0,0,0.7)"; } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -