I'm currently testing and I have a problem I can not solve. I basically want to change the onClick value from a div.btn before I click on it. The javascript code is in react.js and available here. The part I like to change is here:
React.createElement("div", {className: "img"},
React.createElement("div", {className: "btn noShadow", onClick: this.sendVote.bind(this, this.props.data.candidate1.id)}, this.props.data.translations.vote),
React.createElement("img", {src: domain + this.props.data.candidate1.img_challenge_url, onClick: this.sendVote.bind(this, this.props.data.candidate1.id)})
),
I am trying to set the value from div.btn.noShadow to "12345", normally I would just do the following in Tampermonkey:
$("#div.content > div.left > div.img > div.btn.noShadow").attr("onclick", "sendVote(12345)")
But this does not seem to work because react.js changes the DOM. I am fairly new to this and have no idea how to achieve this.