0

Here the point with a exemple :

<h2>        
  <a href="/car/bmw/?load=0&value=5fs4dfsdf45"> </a>
</h2>

I want my querySelector to only select "bmw".

I used it (below), but it's only select the end of the sentence and not the value between "/car/" and "?load"

document.querySelector('h2 > a[href$=]');

Thanks for your help !

4

1 に答える 1

1

try *= instead:

document.querySelector('h2>a[href*=bmw]')
于 2013-01-28T18:37:31.150 に答える