Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:18:19+00:00 2026-06-13T23:18:19+00:00

This code works in Chrome, but not in IE. Why?? It’s so simple but

  • 0

This code works in Chrome, but not in IE. Why?? It’s so simple but I don’t see my mistake.

<script>

function calc() {

        var summ = (parseFloat(q2.value) + parseFloat(q3.value) + parseFloat(q4.value)+ ( parseFloat(qn2.value) + parseFloat(qn3.value) + parseFloat(qn4.value) ) * 6 ) * 1.13;

        summ = parseFloat(summ).toFixed(2);

        document.getElementById('sum2').innerHTML = summ;

        alert(summ);
}

</ script>

And html (delete all text, only input)

<form method="" action="">

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q2"/>

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q3"/>

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q4"/>

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn2"/>

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn3"/>

<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn4"/>


<p><span id="sum2" style="color: red; font-weight: bold;">00.00</span> the result</p>   

<center><input type='button' onclick='calc()' value='Обновить'/></center>

</ html>

What am I doing wrong? I already found that IE doesn’t like name="..." tag and deletes all of them from the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:18:20+00:00Added an answer on June 13, 2026 at 11:18 pm

    Look at the console, it tells you there are errors

    SCRIPT5009: 'q2' is undefined show, line 22 character 9
    

    Do not reference elements by their id directly, you need to use document.getElementById()

    What you need to do is

    parseFloat(document.getElementById("q2").value) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple count down script. The code works in chrome but not
This code works in Chrome and Firefox, but not IE (which is to be
This code works is FF and IE but not in Chrome. Any help would
following code works perfectly on FF and Chrome but not in IE8. $(window).keyup(function(e) {
This code works for chrome as I want but it does not work for
This code works nicely in for example Chrome, but not in Internet Explorer 8/9.
For some reason, this code works all chrome, safari, and ei but not on
This code works properly in Firefox but not in Chrome, If you need more
This code works in FF, Chrome, IE6/8 but not in Safari and Opera. Any
My code works on Chrome but not on Firefox... in Firefox... whenever this piece

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.