Reputation: 883
I have the following jQuery code:
var fnVal = $(_placeHolder[0].parentElement.children[0]).attr('onclick');
While debugging I can see the value of fnVal
as
function onclick(event) {
javascript:DisplayData($('#divexpand')[0],'true');
}
I wish to replace true
in DisplayData
function to false
.
How can I achieve that ?
Upvotes: 0
Views: 82
Reputation: 708206
Just assign it a new function which will replace the old one (also no need for jQuery in this):
_placeHolder[0].parentElement.children[0]).onclick = function() {
DisplayData(document.getElementById('divexpand'),'false');
};
Upvotes: 3