Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

document.queryselector

<div id="fooar"></div>
<div id="foo:bar"></div>

<script>
  console.log('#fooar');               // "#fooar" ( is the backspace control character)
  document.querySelector('#fooar');    // Does not match anything

  console.log('#fooar');              // "#fooar"
  console.log('#foo\bar');            // "#fooar"
  document.querySelector('#foo\bar'); // Match the first div

  document.querySelector('#foo:bar');    // Does not match anything
  document.querySelector('#foo:bar');  // Match the second div
</script>
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+2 =