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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:55:30+00:00 2026-05-18T22:55:30+00:00

Internet Explorer only. <input type=button id=but value=button2/> <textarea id=text cols=40 rows=20></textarea> window.onload = function()

  • 0

Internet Explorer only.

<input type="button" id="but" value="button2"/>
<textarea id="text" cols="40" rows="20"></textarea>

window.onload = function() {
  var el = document.getElementById("text");
  var but = document.getElementById("but");

  el.onbeforedeactivate = function() { alert('out') };
  but.onclick = function() { alert('click') };
}

When I click the button within the textarea (focus is on textarea), I expect both functions to trigger but its not happening.

Why?
Online Example

  • 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-18T22:55:30+00:00Added an answer on May 18, 2026 at 10:55 pm

    alert causes all sorts of trouble, esp. on IE but frankly on other browsers as well. I would avoid it.

    Your example works fine if you don’t use alert, but instead use another way of showing the events have been received:

    window.onload = function() {
      var el = document.getElementById("text");
      var but = document.getElementById("but");
    
      el.onbeforedeactivate = function() { display('out') };
      but.onclick = function() { display('click') };
    
      function display(msg) {
        var p = document.createElement('p');
        p.innerHTML = msg;
        document.body.appendChild(p);
      }
    }
    

    Updated fiddle

    Tested on IE6, 7, and 8. With your original, I get the same result as you (just the “out” alert). With the update, I see both events do in fact occur.

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

Sidebar

Related Questions

Right now I'm working on a Internet Explorer add on which is supposed to
A URL such as http://username:password@example.com/ does not work in Internet Explorer, as explained in
Recently, I came across a set of Internet Explorer Web Controls from Microsoft. These
There is one user who only get a dialogue box and download error when
I have a layout which renders perfectly fine in Webkit based browsers but in
I have posted this on the Google Web Toolkit Discussion Group but hopefully you
I have seen multiple posts and websites regarding this issue, yet none of the
Is it possible to host/embed/ reparent a normal Windows Application into a web page
I'm gettign this strange character instead of an apostrophe on a page that's powered
How can I use HTTP basic Authentication and have the user submit their Username

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.