No products in the cart.
Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
-
January 17, 2020 at 5:10 am in reply to: Get selected text from a drop-down list (select box) using jQuery #9362
kamil-kielczewski
ParticipantTry
dropdown.selectedOptions[0].text
function read() { console.log( dropdown.selectedOptions[0].text ); }
<select id="dropdown"> <option value="1">First</option> <option value="2">Second</option> </select> <button onclick="read()">read</button>
kamil-kielczewski
ParticipantONELINER
subject.onclick = e=> window.scroll({top: submit.offsetTop, behavior:'smooth'});
subject.onclick = e=> window.scroll({top: submit.offsetTop, behavior: 'smooth'});
.box,.foot{display: flex;background:#fdf;padding:500px 0} .foot{padding:250px}
<input type="text" class="textfield" value="click here" id="subject" name="subject"> <div class="box"> Some content <textarea></textarea> </div> <input type="submit" class="submit" id="submit" name="submit" value="Ok, Done."> <div class="foot">Some footer</div>
kamil-kielczewski
ParticipantTry:
element.className='second'
function change(box) { box.className='second' }
.first { width: 70px; height: 70px; background: #ff0 } .second { width: 150px; height: 150px; background: #f00; transition: 1s }
<div onclick="change(this)" class="first">Click me</div>
- AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)