fonts - How change the style of inserted text - javascript -
i have created script interacts html page. in html page user insert in textbox expression. there 5 checkbox in page, checkbox sets font style (big, fixed, strike, bold etc...). depending on selected checkboxes, must show new windows edit text corresponding @ value of selected checkboxes. in other 2 select box (dimension , colour) of text. html code, can show me example?
<input type="text" id="testo"><br> <label>big</label><input type="checkbox" id="big"><br> <label>italics</label><input type="checkbox" id="italics"><br> <label>bold</label><input type="checkbox" id="bold"><br> <label>fixed</label><input type="checkbox" id="fixed"><br> <label>strike</label><input type="checkbox" id="strike"><br> <label>sub</label><input type="checkbox" id="sub"><br> <label>colore</label><select id="colore"> <option value="1">blue</option> <option value="2">green</option> </select><br> <label>dimensione</label><select> <option value="1">1</option> <option value="3">3</option> <option value="5">5</option> <option value="7">7</option> </select> <br> <input type="button" value="mostra testo" onclick="show()">
using jquery
can in following way:
function show() { $('testo').css('background-color', function(){ return $('colore').value() }) }
for more details check out .css. did not test code, should this.
Comments
Post a Comment