³ÉÈËÂÛ̳

Please turn on JavaScript. To find out how to do this visit the .

Overview

Using the glow.events.removeListener method it is possible to remove event listeners that you have created with the glow.events.addListener method.

Below is a simple example of how to use the removeListener method. The button has no code applied to it by default, however clicked on the checkbox will give the button a JavaScript alert box:

HTML

<input type="checkbox" id="listener_switch" />
<label for="listener_switch">Alert on/off</label>
<input type="button" id="listener_target" value="ALERT" />

JavaScript

// This variable stores the event listener
var alert_listener;
// Add an event listener onto the radio box to listen for clicks
glow.events.addListener("input#listener_switch", "click", function(event) {
	// If the check box is checked then add the event listener onto the button
	if(this.checked) {
		alert_listener = glow.events.addListener("input#listener_target", "click", function() {
			alert("ALERT");
		});
	// Else remove the event listener from the button
	} else {
		glow.events.removeListener(alert_listener);
	}
});

³ÉÈËÂÛ̳ iD

³ÉÈËÂÛ̳ navigation

³ÉÈËÂÛ̳ © 2014 The ³ÉÈËÂÛ̳ is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.