2
I need to do a Javascript function and I want it to receive the parameters in text format:
HTML code:
<button onClick="AlteraNome(Felipe)">Enviar Nome</button>
Javascript code:
function AlteraNome(nome){
document.write(nome);
}
If anyone can help me, I’d appreciate it!
I suppose you want to take the value from a
input
right? Click [Edit] and add your form.– user28595
Or if you want to pass a fixed text, you can put it between apostrophes (
onClick="AlteraNome('Felipe');"
)– carlosfigueira