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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:06:02+00:00 2026-05-28T04:06:02+00:00

I am using prototype 1.7.0. I am having a HTML code like the below

  • 0

I am using prototype 1.7.0.
I am having a HTML code like the below mentioned tag.
I have added a custom method onhide.

<div id="showButton" onclick="javascript:hello();" onhide="onNamehide()">show</div>

Now when I click, $('showButton').onhide evaluates to true is displayed in IE8 and false in IE9, firefox.

 function hello(){
   if($('showButton').onhide){
     alert("I am able to find onhide function");
   } else {
     alert("Sorry, I am not able to find onhide function");
   }
 }   

Can someone please explain to me this?

  • 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-28T04:06:03+00:00Added an answer on May 28, 2026 at 4:06 am

    See Element#hasAttribute

    if ($('showButton').hasAttribute('onhide')) {
    

    The reason that testing for onhide only sometimes works is complex and subtle. Technically the object returned by $('showButton') is a javascript representation of the DOM, it is not the HTML element per se. Older browsers would confuse the issue by treating HTML attributes as DOM properties, but setting a DOM property didn’t always set the HTML attribute. As browsers grow closer to the specification the difference is becoming more accurate.

    Try to write code to the specification rather than implementation by using functions like getAttribute and setAttribute (abstracted in Prototype as readAttribute and writeAttribute for the sake of cross-browserness).

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

Sidebar

Related Questions

I'm using Prototype's PeriodicalUpdater to update a div with the results of an ajax
I'm using prototype.js for my web app, and I have everything running on Chrome,
I am (stuck) using Prototype 1.3.1 and I'm having a hard time moving from
How can I hide all divs having the class myclass using Prototype? I guess
I'm trying to add a toBool() method inside the Object object using prototype... something
I am having two maps which are overlayed using div. However whenever I pan
I am having a HTML like <a href=yourpath/controller/views/username class=classname>username</a> How to read the attribute
I am using prototype and have the following javascript: function displayDefinition(term){ var term_id =
Im having problem's adding map markers to gmaps using jquery. Here is my code
Im having trouble unsetting a key within an array using prototype (though this is

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.