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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:38:28+00:00 2026-05-11T15:38:28+00:00

In addition to the explanation, what does the $ mean in javascript? Here is

  • 0

In addition to the explanation, what does the $ mean in javascript? Here is the code:

var ZebraTable = {     bgcolor: '',     classname: '',     stripe: function(el) {         if (!$(el)) return;         var rows = $(el).getElementsByTagName('tr');     for (var i=1,len=rows.length;i<len;i++) {         if (i % 2 == 0) rows[i].className = 'alt';         Event.add(rows[i],'mouseover',function() {  ZebraTable.mouseover(this); });     Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); });     } }, mouseover: function(row) {     this.bgcolor = row.style.backgroundColor;     this.classname = row.className;     addClassName(row,'over'); }, mouseout: function(row) {     removeClassName(row,'over');     addClassName(row,this.classname);     row.style.backgroundColor = this.bgcolor; } }  window.onload = function() { ZebraTable.stripe('mytable'); } 

Here is a link to where I got the code and you can view a demo on the page. It does not appear to be using any framework. I was actually going through a JQuery tutorial that took this code and used JQuery on it to do the table striping. Here is the link:

http://v3.thewatchmakerproject.com/journal/309/stripe-your-tables-the-oo-way

  • 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. 2026-05-11T15:38:29+00:00Added an answer on May 11, 2026 at 3:38 pm

    Can someone explain the following javascript code?

    //Shorthand for document.getElementById function $(id) {     return document.getElementById(id); }  var ZebraTable = {     bgcolor: '',     classname: '',      stripe: function(el) {         //if the el cannot be found, return         if (!$(el)) return;          //get all the <tr> elements of the table         var rows = $(el).getElementsByTagName('tr');          //for each <tr> element         for (var i=1,len=rows.length;i<len;i++) {              //for every second row, set the className of the <tr> element to 'alt'             if (i % 2 == 0) rows[i].className = 'alt';              //add a mouseOver event to change the row className when rolling over the <tr> element             Event.add(rows[i],'mouseover',function() {                 ZebraTable.mouseover(this);              });              //add a mouseOut event to revert the row className when rolling out of the <tr> element             Event.add(rows[i],'mouseout',function() {                  ZebraTable.mouseout(this);              });         }     },      //the <tr> mouse over function     mouseover: function(row) {         //save the row's old background color in the ZebraTable.bgcolor variable         this.bgcolor = row.style.backgroundColor;          //save the row's className in the ZebraTable.classname variable         this.classname = row.className;          //add the 'over' class to the className property         //addClassName is some other function that handles this         addClassName(row,'over');     },     mouseout: function(row) {         //remove the 'over' class form the className of the row         removeClassName(row,'over');          //add the previous className that was stored in the ZebraTable.classname variable         addClassName(row,this.classname);          //set the background color back to the value that was stored in the ZebraTable.bgcolor variable         row.style.backgroundColor = this.bgcolor;     } }  window.onload = function() {     //once the page is loaded, 'stripe' the 'mytable' element     ZebraTable.stripe('mytable'); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 413k
  • Answers 413k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this geom_text(data=subset(dfm, Date == 1), aes(x=Date), size=12, hjust=1, vjust=0)… May 15, 2026 at 8:20 am
  • Editorial Team
    Editorial Team added an answer You should be able to store the whole object from… May 15, 2026 at 8:20 am
  • Editorial Team
    Editorial Team added an answer Do you really need an installer? It's most macish to… May 15, 2026 at 8:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.