HOME > > > > >

:contains(text)

引数

(strin)text

戻り値

jQuery

textというテキストを含む要素を取得

サンプル

実行結果

  • git init
  • git clone <複製元リポジトリのURL>
  • git status
  • git diff <ファイル名>
  • git add <ファイル名> <ファイル名> ....
  • git commit
  • git log
  • git reset --soft HEAD^
  • git revert <コミット名>
  • git branch <ブランチ名>
  • git checkout <ブランチ名>
  • git show-branch
  • git merge <他のブランチ名>
  • git tag <タグ名>
  • git stash <保存名>
  • git rebase <派生元ブランチ>
  • git pull <取り込み元リポジトリ>
  • git push <送信先リポジトリ> <送信するブランチ> <送信先ブランチ>

git コマンドと git-vim コマンド一覧

Javascript

  1. $('.jqTest').click(function(e){
  2.     if ($(e.target).attr('class') === 'contains') {
  3.         var text = $(e.target).val();
  4.         $(':contains(' + text + ')', $(this).find('ul')).css({backgroundColor: $(e.target).data('color')});
  5.     }
  6. });

HTML

  1. <div class="jqTest">
  2.     <div class="referText">
  3.         <blockquote>
  4.         <ul>
  5.         <li>git init</li>
  6.         <li>git clone &lt;複製元リポジトリのURL&gt;</li>
  7.         <li>git status</li>
  8.         <li>git diff &lt;ファイル名&gt;</li>
  9.         <li>git add &lt;ファイル名&gt; &lt;ファイル名&gt; ....</li>
  10.         <li>git commit</li>
  11.         <li>git log</li>
  12.         <li>git reset --soft HEAD^</li>
  13.         <li>git revert &lt;コミット名&gt;</li>
  14.         <li>git branch &lt;ブランチ名&gt;</li>
  15.         <li>git checkout &lt;ブランチ名&gt;</li>
  16.         <li>git show-branch</li>
  17.         <li>git merge &lt;他のブランチ名&gt;</li>
  18.         <li>git tag &lt;タグ名&gt;</li>
  19.         <li>git stash &lt;保存名&gt;</li>
  20.         <li>git rebase &lt;派生元ブランチ&gt;</li>
  21.         <li>git pull &lt;取り込み元リポジトリ&gt;</li>
  22.         <li>git push &lt;送信先リポジトリ&gt; &lt;送信するブランチ&gt; &lt;送信先ブランチ&gt;</li>
  23.         </ul>
  24.         </blockquote>
  25.         <p><a href="http://www.serendip.ws/archives/1726">git コマンドと git-vim コマンド一覧</a></p>
  26.     </div>
  27.  
  28.     <input type="button" value="ファイル名" class="contains" data-color="#FFFAC6">
  29.     <input type="button" value="リポジトリ" class="contains" data-color="#859900">
  30.     <input type="button" value="ブランチ" class="contains" data-color="#4272DB">
  31. </div>
参照ページ