問題タブ [angularjs-ng-style]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - JavaScript 特定のスパン値を取得する「ng-style」
コードは次のとおりです。
そして、多くの同様のスパン。
document.querySelector(span[ng-style="item.disable_method?{'opacity':'.5'}:{}"]
) を使用して値を取得したいのですCredit Card
が、すべてのスパン ID が同じであるため、別の支払い方法を受け取っています。
編集:
私の質問は明確ではありませんでした。最初のものへの参照を取得したい。
Likevar payment_Method = document.querySelector
または任意の方法で、likepayment_Method.innerHTML
を使用して「クレジットカード」の返品を取得できます
どうすれば正しくなりますか?たぶんループか何か。
document.getElementsByClassName('ng-binding')[Change_Able_Value].innerText
値の変更として使用できません。