Skip to content

Tag: javascript

Cannot click input element within button element

Take a look at the below markup & fiddle: http://jsfiddle.net/minlare/oh1mg7j6/ In Chrome, each element within the button can be selected through the developer console and js click events are delegated. In Firefox/IE you cannot select the child elements or pickup js click events. Is there a way around thi…

Return JavaScript class value instead of object reference

I would like to know if there is a way to return a JS class’s value by default instead of of reference to the class object itself. Let’s say, for example, I want to wrap a string.. and now I want to get string just by using myString rather than myString.string. Is this doable somehow? Edit I took …

ECMAScript 6 class destructor

I know ECMAScript 6 has constructors but is there such a thing as destructors for ECMAScript 6? For example if I register some of my object’s methods as event listeners in the constructor, I want to remove them when my object is deleted. One solution is to have a convention of creating a destructor meth…

React – getting a component from a DOM element for debugging

For the purposes of debugging in the console, is there any mechanism available in React to use a DOM element instance to get the backing React component? This question has been asked previously in the context of using it in production code. However, my focus is on development builds for the purpose of debuggi…