How to do a ‘select-all’ focus on a TextArea upon tab?
When tabbing through the fields I realized that the input focus behaves different from the TextArea. The TextArea doesn’t select its text… but it can be fixed by adding some jQuery.
Click to ‘select all’ on the PRE element
When you want to display code, you’re probably working with pre elements. The fact that they can contain markup make them really effective for syntax highlighting. I’ve used Knockout en comment binding to generate code into a pre field and that’s really cool.
Solving Knockout JS calculated bindings Syntax Error
Doing calculations on Knockout data-binds might result into a “Uncaught SyntaxError: Unable to parse bindings” error. Solution: use an anonymous function!
Using Chrome’s XPath with jQuery
While working with the Chrome Developer Tool I’ve discovered that you can retrieve the XPath of a selected node, But… it only works in Chrome. So what about other browsers? What about jQuery? What about querying documents that resulted from an AJAX request?
About the Author
Hi! I'm Kees. Thanks for checking out my Blog. I work as a .Net Engineer for one of the biggest web-shops in the Netherlands: wehkamp. I ❤️ C# and I like to solve nifty problems.Learn more