1

For example

$('input[name="form[some_ids]"]')

What does the inner bracket represents?

user445670
  • 179
  • 8
  • 4
    They're not interpreted specially. They're just characters to be looked for in the "name" attribute of elements. – Pointy Sep 15 '15 at 00:40
  • @Pointy great answer! :) – beautifulcoder Sep 15 '15 at 01:04
  • For a little bit more clarity, the selector could be `$('input[name="form[()!]4#"]')` and it wouldn't make a difference. anything inside the `""` for name is simply a string. The reason the brackets will be there is that the field will have it's name attribute set as such so a backend programming language can interpret the resulting output as an array (e.g. in php you could access `$_POST['form']['some_ids']` ). – Hailwood Sep 15 '15 at 01:06

2 Answers2

2

Per @Pointy, it will match something like this.

<input name="form[some_ids]" />

The inner bracket is not part of the selector.

beautifulcoder
  • 10,832
  • 3
  • 19
  • 29
0

The inner bracket usually repesents an input array. Here's a link that explains it a bit:

HTML input arrays

Community
  • 1
  • 1