2016-10-05 18 views

答えて

1

id="Test"はユニークかつ安定していると仮定して、以下のようなコードは動作します:

<a id="Test" class="button_primary button_left_padding tlignore disabled" role="button" 

へ:

例えば、私は変更したいですAJAX-Dについては
var targNode = document.getElementById ("Test"); 
targNode.classList.remove ("disabled"); 
targNode.classList.add ("enabled"); 


この完全なスクリプトは動作します:

// ==UserScript== 
// @name  _Flip CSS classes 
// @match http://YOUR_SERVER.COM/YOUR_PATH/* 
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js 
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js 
// @grant GM_addStyle 
// ==/UserScript== 
//- The @grant directive is needed to restore the proper sandbox. 

waitForKeyElements ("#Test", swapClass); 

function swapClass (jNode) { 
    jNode.removeClass ("disabled").addClass ("enabled"); 
} 
関連する問題