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 4562538
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:13:46+00:00 2026-05-21T18:13:46+00:00

window.onload = raknaUtMedelvarde; function raknaUtMedelvarde(){ var tabell = document.getElementById(temperaturtabell); var rader = tabell.getElementsByTagName(tr); for

  • 0
window.onload = raknaUtMedelvarde;

function raknaUtMedelvarde(){

    var tabell = document.getElementById("temperaturtabell");
    var rader = tabell.getElementsByTagName("tr");

    for (var i = 0; i < rader.length; i++){
        var tabellceller = rader[i].getElementsByTagName("td");
        //alert(tabellceller.length);
       //räkna ut medelvärde
        var medel = medelVarde(tabellceller);
        //alert(medel);
        var medelText = document.createTextNode(medel);
        var medelElement = tabellceller [tabellceller.length - 1];
        medelElement.appendChild(medelText);


    }
}

function medelVarde(celler){
    var summa = 0;
    for (var i = 1; i < celler.length - 1; i++){

         var nuvarandeVarde = celler[i].firstChild.nodeValue;
         summa = summa + parseInt(nuvarandeVarde);
    }
    return summa / 5;
}
// code behind "visa värde" (show the value)
//I think here somewhre is the problem?

function hitta(){

    var varde = parseInt(document.getElementById("varde").value);
   var tabell = document.getElementById("temperaturtabell");
    var rader = tabell.getElementsByTagName("tr");

    for ( var i = 0; i < rader.length; i++){

        var tabellceller = rader[i].getElementsByTagName("td");
       // checkpoint to see is the values is >= then the enter value
        if(haVarde (varde, tabellceller))
           rader[i].className = "emp";


    }
}

// boolean method to check the value
function haVarde(varde, celler){
    var harVarde = false;
    var sum = 0;
    for (var i = 1; i = celler.length -1; i++){

        var nuvarandevarde = parseInt(celler[i].firstChild.nodeValue);
            if ( nuvarandevarde  >= varde)
            {
                harVarde = true;
                celler[i].className = "emptd";
            }
    }
    return harVarde;
}

Hello there!

Im writing this code. The momment I try to check the value with the total data inside the table. FF starts crashing sort of to say..I’m having problems dont know where pls have a look at the message: http://dl.dropbox.com/u/3632213/what.jpg …mm ,mm can’t understand the message…any suggestions more than welcome! 🙂

  • 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-05-21T18:13:47+00:00Added an answer on May 21, 2026 at 6:13 pm

    This line:

    for (var i = 1; i = celler.length -1; i++){
    

    will cause an infinite loop.

    You probably meant <= ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

window.onload = function() { document.getElementById('clickMe').onclick = runTheExample; } function runTheExample() { alert('running the example');
I have a js code: window.onload = function() { document.getElementById(Button1).onclick = function() { var
This works: <div id=hello style=width:100%;></div> <script> window.onload = function(){ alert(document.getElementById(hello).style.width); }; </script> This does
<html> <head> <title>Sample</title> <script> window.onload = function() { alert(document.getElementById('div1').style.zIndex); alert(document.getElementById('div2').style.zIndex); } </script> <style type=text/css
script : window.onload = initForms; function initForms() { for (var i=0; i< document.forms.length; i++)
This is my script : window.onload = function (){ var title = document.getElementsByTagName('h1')[0].id =
window.onload = function(){ $('.content').bind({click:function(){ var len = $('.main').children().length; var id1 = $(this).attr('id'); alert(id+$(this).attr('id')); var
window.onload = function(e){ cells = document.getElementsByName('assetID'); for(j = 0; j < cells.length; j++) cells[j].style.display
In most browsers, the following would work. window.onload = function(){ console.log( document.getElementById('svgElm').getBoundingClientRect().width ); };
I have this script: window.onload = function(){ document.getElementById('workspace').oncontextmenu = function(){ return false; } }

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.