V
V
Valen962018-02-11 21:55:41
css
Valen96, 2018-02-11 21:55:41

How to correctly handle the change() event?

Tell me, I want to make an input in which you can enter values ​​​​for the text size font-size and which will automatically set such a css text property
on the input when changing the field, hung this event onchange = "func (this. value);
and the function is this
function func (newfsize)
{
$("p").css("font-size", function(newfsize){
return newfsize;
});
}

This function for all paragraphs, which value I did not enter, sets font-size 3px; Tell me how it is implement more correctly, no matter how jquery or js.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sklyarov, 2018-02-11
@Valen96

https://jsfiddle.net/wq9qr4Lr/2/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question