简体   繁体   中英

Dropdown Menu doesn't update textfield values in Chrome, but works fine in Firefox and IE

I am making a simple calculator web application using HTML and Javascript. I will style it once I get it to work.

Here is the link to the source code in Javascript: Calculator, unnecessary parts blanked out

My problem:

The calculator has certain percentage values depending on the calendar year, hence changing the year should change the values in the input text fields.

This works fine in Firefox and IE (once you enable blocked content) but refuses to work in Chrome. I've released that Chrome has tighter security policies, so I added a document event handler but this still does not work while using Chrome. I've attached the relevant code please help this is driving me mad.

事件监听click change ,试试看。

document.getElementById('year').addEventListener('change', handleOnclick);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM