Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Why is this JavaScript button click failing to call a function?

Crystal Kim:

I am beginner of Javascript. but it doesn't work. plz help me.

I am using Microsoft VSCode.

This is my main.html.













Ultimate R-S-P






This is script.js


console.log("start!");

var loginBtn = document.getElementById("loginbtn");

loginBtn.onclick = function(){

console.log("onclick event start");

};



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Why is this JavaScript button click failing to call a function?

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×