Monday 15 July 2013

html - Javascript if slider value = 20 , display text -


I have created a slider using HTML and CSS which displays its value on the change. I'll call it & lt; Style & gt; Styled using CSS using the tag I went to create value display text then I want to display the "starter" when the slider hits 20. I do not know what I'm doing and why it is not working for me, I would like to use the most user-friendly version of this. If possible, please tell me what I did.

  & lt; Html & gt; & Lt; Style & gt; Input [type = "category"] {-webkit- presence: none; Width: 100%; Height: 25px; Border: 1 px solid; Background color: # 0066ff; } Input [type = "category"] :: - webkit-slider-thumbs {-webkit-appearance: none; Width: 25px; Height: 25px; Border: 1 px solid; Background color: #fff; } & Lt; / Style & gt; & Lt; / Html & gt; & Lt; Form oninput = "amount.value = rangeInput.value" & gt; & Lt; Input type = "category" id = "rangeInput" name = "rangeInput" step = "20" value = "0" & ​​gt; = "RangeInput" & gt; 0 & lt; / Output & gt; & Lt; / Div & gt; For & lt; Div align = "center" style = "font-size: 25px;" & Gt; Output name = "zodiac" & lt; / Form & gt; & Lt; Script type = "text / javascript" & gt; Var rangeInput = document.getElementById ("rangeInput"). If value (rangeInput = 20) {text = "starter"}  

How do I reset my slider to value 0?

At this time, if I go from 20 to 0, it stays on displaying the starter, so I will remove it. Is this possible?

You need '=' instead of 'if' statement

 < Code> var rangeInput = document.getElementById ("rangeInput"). If value (rangeInput == 20) {text = "starter"}  

No comments:

Post a Comment