Html –
<div class="pageEdit" value="Create|8765678|FOOD=6578~-8765678?|9381">
<a href="https://host:controller">Edit</a>
</div>
I want to get the value inside the div and pass that in a Javascript method after splitting pipe.
$(".pageEdit").on('click',function(event){
var data = $(".pageEdit").text().split("|");
functionPageCreate(data(0),data(1),data(2),data(3));
});
This is not working. I do not have much experience in JS/jQuery. Please let me know how can I do that.
2
Answers
You can try below code:
You should use another attribute to store data.
Then retrieve it using