I want to replace parameter of the function in javascript.Eg:
I have one function DeleteProduct("2")
and in some condition i want to replace the parameter of DeleteProduct()
function. Like that:
DeleteProduct("1")
I have tried this(means how i am replacing the parameter value):
$('#Addr1Div').html($('#Addr2Div').html().replace(/"2"/g, '"1"'));
But its not working.
I am calling function like that:
<a href='javascript:$.DeleteProduct(\"2\");'>Delete</a>
replace it exactly in href attribute
var newHref = $('a').attr('href').replace(/"2"/g, '"1"');
// or whatever you use to access <a>
$('a').attr('href', newHref);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다