<div id="abc" onclick="location.href='/new-data/?asd=asd'">
</div>
私が必要とする出力new-data
はlocation.href
.
jQuery または JavaScript を使用してどのように行うのですか?
<div id="abc" onclick="location.href='/new-data/?asd=asd'">
</div>
私が必要とする出力new-data
はlocation.href
.
jQuery または JavaScript を使用してどのように行うのですか?
div idは「abc」で、onclickの値は常に次の形式であるため、このようなものです
whatever/somedata/whatever
function GetTheContentFromOneSpecialCharacterToAnotherOne()
{
var the_full_content = document.getElementById('abc').getAttribute('onclick');
var the_parts = the_full_content.split('/');
return the_parts[1];
}