How To Match Complex Element IDs In jQuery

Author: , July 22nd, 2021

PROBLEM: An element ID that looked like this would fail to match: service = east node = db1-demo.thedomain.com

SOLUTION: Rig any special characters in the complex hostname (:.[],-@) with a backslash in front of them to ensure proper matching:

How To Find the AWS Region and Availability Zone Via the CLI

Author: , June 30th, 2015

/opt/aws/bin/ec2-metadata | grep placement

How To Get Smarty html_radios To Display An ID

Author: , October 1st, 2012

Add the parameter label_ids=true. For example:

How To Create An Input Field Watermark Using jQuery

Author: , September 20th, 2011

Here is a VERY simplistic watermark code snippet. It has the distinct disadvantage of submitting the watermark string as the field value, and does not set the initial field value either…YMMV…

http://api.jquery.com/focusin/

How To Match Long ID Strings Using JQuery

Author: , August 19th, 2011

Ran into an odd issue matching the id attribute in jQuery when it is extra-long. Seems like the syntax: jQuery(‘#LongIDNameGoesHere’) doesn’t match long ID’s, when the syntax: jQuery(‘[id^=LongIDNameGoesHere]’) does match correctly. Not entirely sure yet why this is, but figured it is best to document the facts as I found them…

How To Find Which Button Was Clicked To Submit A Form Using jQuery

Author: , July 2nd, 2011

How To Check If An ID Exists Using jQuery

Author: , May 10th, 2011

Use the .length property: