input - Html/CSS/JavaScript -


i doing site can write text in input fields, there 3 option menus can change text color, background color , font-style. when choose options background color , the text color outside input field change...what going change in field?

edit: can change background text color in input field, cannot change font style...i cant see whats wrong?

<!doctype html>  <html>  <head>  <title>visitkort</title>   <link rel='stylesheet' type='text/css' href='style.css' />    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>  <script type="text/javascript">    function skrivut() {                    var foretag = document.getelementbyid('foretag');          foretag.value = document.getelementbyid('foretagtext').value;  	var efternamn = document.getelementbyid('efternamn');  		efternamn.value = document.getelementbyid('efternamntext').value;          document.getelementbyid('fornamnnamn').value = document.getelementbyid('fornamnnamntext').value;          document.getelementbyid('title').value = document.getelementbyid('titletext').value;          document.getelementbyid('telefon').value = document.getelementbyid('telefontext').value;          document.getelementbyid('epost').value = document.getelementbyid('eposttext').value;

.form-style-3{      max-width: 400px;  	max-height 400px;    font-family: "comic sans ms", cursive, sans-serif;

let's input field <input></input>. can use css style element , change text color.

you can access element css selector. can find out more selectors here: http://www.w3schools.com/cssref/css_selectors.asp

in example can give input field id

<input id="example"></input> 

and css:

#example {     color: yourcolor; } 

if want change style in javascript with:

element.style.color = "yourcolor"; 

the element input field. can method document.getelementbyid("example");


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -