204
204
background-color : # fefefe ;
205
205
border : 2px solid # c1c1c1 ;
206
206
}
207
+ .slidecontainer {
208
+ width : 100% ;
209
+ }
210
+ .slider {
211
+ -webkit-appearance : none;
212
+ width : 100% ;
213
+ height : 20px ;
214
+ background : # d3d3d3 ;
215
+ outline : none;
216
+ opacity : 0.7 ;
217
+ -webkit-transition : .2s ;
218
+ transition : opacity .2s ;
219
+ }
220
+ .slider : hover {
221
+ opacity : 1 ;
222
+ }
223
+ .slider ::-webkit-slider-thumb {
224
+ -webkit-appearance : none;
225
+ appearance : none;
226
+ width : 16px ;
227
+ height : 28px ;
228
+ background : # 4CAF50 ;
229
+ cursor : pointer;
230
+ }
231
+ .slider ::-moz-range-thumb {
232
+ width : 16px ;
233
+ height : 28px ;
234
+ background : # 4CAF50 ;
235
+ cursor : pointer;
236
+ }
207
237
</ style >
208
238
</ head >
209
239
< body >
@@ -259,8 +289,13 @@ <h3>Automation Practice</h3>
259
289
< td > Placeholder Text Field:</ td >
260
290
< td > < input id ="placeholderText " type ="text "
261
291
placeholder ="Placeholder Text Field " /> </ td >
262
- < td > < p > Paragraph with Text:</ p > </ td >
263
- < td > < p id ="pText " style ="color: green; font-size: 20px; "> This Text is Green</ p > </ td >
292
+ < td > Read-Only Text Field:</ td >
293
+ < td >
294
+ < input type ="text " id ="readOnlyText "
295
+ value ="The Color is Green "
296
+ style ="font-size: 19px; color: green; width: 94%; "
297
+ readonly />
298
+ </ td >
264
299
</ tr >
265
300
< tr >
266
301
< td > HTML SVG with rect:</ td >
@@ -277,32 +312,27 @@ <h3>Automation Practice</h3>
277
312
</ rect >
278
313
</ svg >
279
314
</ td >
280
- < td > < label id =" progressLabel " for =" progressBar " > Progress Bar: (50%) </ label > </ td >
281
- < td > < progress id ="progressBar " value =" 50 " style ="width: 94%; " max =" 100 " / ></ td >
315
+ < td > < p > Paragraph with Text: </ p > </ td >
316
+ < td > < p id ="pText " style ="color: green; font-size: 20px; " > This Text is Green </ p > </ td >
282
317
</ tr >
283
318
< tr >
284
- < td > < div style =" color: gray; " > Disabled Text Field: </ div > </ td >
319
+ < td > Input Slider Control: </ td >
285
320
< td >
286
- < input type ="text "
287
- style ="color: gray; "
288
- value ="NOT Editable! " disabled
289
- id ="disabledTextFieldId "
290
- name ="disabledTextFieldName "
291
- class ="disabledTextFieldClass "/>
292
- </ td >
293
- < td > Read-Only Text Field:</ td >
294
- < td >
295
- < input type ="text " id ="readOnlyText "
296
- value ="The Color is Green "
297
- style ="font-size: 18px; color: green; width: 94%; "
298
- readonly />
321
+ < input type ="range " min ="0 " max ="4 " step ="1 "
322
+ id ="mySlider " name ="sliderName " value ="2 "
323
+ style ="width: 88%; " class ="slider "
324
+ onclick ="sliderFunction1() "
325
+ onchange ="sliderFunction1() "
326
+ onmousemove ="sliderFunction1() "/>
299
327
</ td >
328
+ < td > < label id ="progressLabel " for ="progressBar "> Progress Bar: (50%)</ label > </ td >
329
+ < td > < progress id ="progressBar " value ="50 " style ="width: 94%; " max ="100 " /> </ td >
300
330
</ tr >
301
331
< tr >
302
332
< td > Select Dropdown:</ td >
303
333
< td >
304
334
< select id ="mySelect " name ="selectName "
305
- class ="selectClass " onChange ="selectFunction1() "
335
+ class ="selectClass " onchange ="selectFunction1() "
306
336
style ="width: 95%; font-size: 14px; ">
307
337
< option value ="25% "> Set to 25%</ option >
308
338
< option value ="50% "> Set to 50%</ option >
@@ -386,17 +416,13 @@ <h3>Automation Practice</h3>
386
416
var x = document . getElementById ( "myButton" ) ;
387
417
var y = document . getElementById ( "pText" ) ;
388
418
var z = document . getElementById ( "readOnlyText" ) ;
389
- var p = document . getElementById ( "progressBar" ) ;
390
- var pl = document . getElementById ( "progressLabel" ) ;
391
419
if ( x . style . color != "purple" ) {
392
420
x . style . color = "purple" ;
393
421
x . textContent = "Click Me (Purple)" ;
394
422
y . textContent = "This Text is Purple" ;
395
423
y . style . color = "purple" ;
396
424
z . value = "The Color is Purple" ;
397
425
z . style . color = "purple" ;
398
- p . value = "100" ;
399
- pl . textContent = "Progress Bar: (100%)" ;
400
426
}
401
427
else {
402
428
x . style . color = "green" ;
@@ -405,9 +431,34 @@ <h3>Automation Practice</h3>
405
431
y . style . color = "green" ;
406
432
z . value = "The Color is Green" ;
407
433
z . style . color = "green" ;
434
+ }
435
+ }
436
+ </ script >
437
+ < script >
438
+ function sliderFunction1 ( ) {
439
+ var s = document . getElementById ( "mySlider" ) ;
440
+ var p = document . getElementById ( "progressBar" ) ;
441
+ var pl = document . getElementById ( "progressLabel" ) ;
442
+ if ( s . value == "0" ) {
443
+ p . value = "0" ;
444
+ pl . textContent = "Progress Bar: (0%)" ;
445
+ }
446
+ if ( s . value == "1" ) {
447
+ p . value = "25" ;
448
+ pl . textContent = "Progress Bar: (25%)" ;
449
+ }
450
+ if ( s . value == "2" ) {
408
451
p . value = "50" ;
409
452
pl . textContent = "Progress Bar: (50%)" ;
410
453
}
454
+ if ( s . value == "3" ) {
455
+ p . value = "75" ;
456
+ pl . textContent = "Progress Bar: (75%)" ;
457
+ }
458
+ if ( s . value == "4" ) {
459
+ p . value = "100" ;
460
+ pl . textContent = "Progress Bar: (100%)" ;
461
+ }
411
462
}
412
463
</ script >
413
464
< script >
0 commit comments