[JavaScript][jQuery] How to Get DOM Elements

Tadashi Shigeoka ·  Sun, October 16, 2011

I looked up how to get DOM Elements with jQuery, so here’s a memo.

The following JavaScript code and jQuery code return the same result.

■ JavaScript

document.getElementById('contents');

■ jQuery

jQuery('#contents').get(0);

That’s all.

【Reference】

jQueryからDOM Elementを取得 - ゆっくりゆっくり (Getting DOM Element from jQuery - SlowlySlowly)

That’s all from the Gemba.