Reputation: 13
I get the Syntax missing ) error
$(document).ready(function changeText() {
var p = document.getElementById('bidprice');
var btn = document.getElementById('paybtn');
var txt = document.getElementById('theText');
btn.onclick( p.textContent = txt.value; );
});
what exactly is the wrong thing I have tried looking at my syntax seems okay
Upvotes: 0
Views: 72
Reputation: 11297
You have a ;
, and onclick
property should be a function.
btn.onclick( p.textContent = txt.value; );
^
Remove it, and wrap everything in a function:
btn.onclick = function(){
p.textContent = txt.value;
};
Upvotes: 2
Reputation: 752
I believe it is because you are trying to name your function in the parameter passed into 'ready'.
First line should be:
$( document ).ready(function() {
Upvotes: 0