:button【ボタン要素】セレクタ

メモ

構文

jQuery( ":button" ) 1.0

関連


<div id="id1">
  <p>
    <button>&lt;button&gt;</button>
    <button type="button">&lt;button type="button"&gt;</button>
    <button type="submit">&lt;button type="submit"&gt;</button>
    <button type="reset">&lt;button type="reset"&gt;</button>
  </p>
  <p>
    <input type="button" value='<input type="button">'>
    <input type="submit" value='<input type="submit">'>
    <input type="reset" value='<input type="reset">'>
    <input type="image" value='<input type="image">' style="border:1px black solid;">
  </p>
  <p>
    <input type="file">:&lt;input type="file"&gt;
  </p>
</div>

<script>
$( "#id1 :button" ).css( "border", "2px red dashed" );
</script>

:<input type="file">


<div id="id2">
  <p>
    <button>&lt;button&gt;</button>
    <button type="button">&lt;button type="button"&gt;</button>
    <button type="submit">&lt;button type="submit"&gt;</button>
    <button type="reset">&lt;button type="reset"&gt;</button>
  </p>
  <p>
    <input type="button" value='<input type="button">'>
    <input type="submit" value='<input type="submit">'>
    <input type="reset" value='<input type="reset">'>
    <input type="image" value='<input type="image">' style="border:1px black solid;">
  </p>
  <p>
    <input type="file">:&lt;input type="file"&gt;
  </p>
</div>

<script>
$( "#id2 *" ).filter( ":button" ).css( "border", "2px blue dashed" );
</script>

:<input type="file">


<div id="id3">
  <p>
    <button>&lt;button&gt;</button>
    <button type="button">&lt;button type="button"&gt;</button>
    <button type="submit">&lt;button type="submit"&gt;</button>
    <button type="reset">&lt;button type="reset"&gt;</button>
  </p>
  <p>
    <input type="button" value='<input type="button">'>
    <input type="submit" value='<input type="submit">'>
    <input type="reset" value='<input type="reset">'>
    <input type="image" value='<input type="image">' style="border:1px black solid;">
  </p>
  <p>
    <input type="file">:&lt;input type="file"&gt;
  </p>
</div>

<script>
$( "#id3 *" ).filter( ":button, :reset, :submit, :image, :file" ).css( "border", "2px red dashed" );
</script>

:<input type="file">