JavaSCript Question

EmailMaster

Elite Member
Joined
May 28, 2011
Messages
4,143
Reaction score
1,209
Hi,

Im new to javascript

This is what im trying to do. On my html page I have to have 4 different font sizes one thats 10px 20px 30px 40px then reset

When i click or rollover on 10px the font size changes and displays the new size of the font in the Div Box.

Also I have an input box so when i type in the input box and press submit it shows the text you typed in and displays it within the div box with the font assigned in the css.

Thanks
 
I am not sure what you need. With Javascript you can access to DOM. DOM is represenation of your html code. So you can access to every html tag (like <input ... /> ...) and do almost everything.

In the example below. There is input element and in javascript I get element by ID and get atribute value of this element and print it to alert window. There is a lots of examples on internet.
Code:
<input id="myid" value="value" type=".." />

<script>
var inputElement = getElementById("myid");
var value = inputElement.getAttribute('value');
alert(value);
</script>
 
Back
Top