2

Is it possible to find a <div> with some specific "data-name" attribute value?

For example: I need to find the <div data-name="place"> to include some code in it dynamically.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
CainaSouza
  • 1,417
  • 2
  • 16
  • 31
  • 3
    The [jQuery attribute equals selector](https://api.jquery.com/attribute-equals-selector/), also there are [many more selectors that jQuery supports](http://api.jquery.com/category/selectors/). – ajp15243 Apr 17 '14 at 17:17
  • I think your question is already answered [here][1]. [1]: http://stackoverflow.com/questions/2487747/selecting-element-by-data-attribute?rq=1 – huizar_mx Apr 17 '14 at 17:17

1 Answers1

11

Sure, use $('div[data-name="place"]')

j08691
  • 204,283
  • 31
  • 260
  • 272