Reputation: 149
im trying to get the title in function getProj(lvrow)
. but i dont know whats wrong in my javascript.
heres my javascript
function getProj(lvrow){
var btnhd = document.getElementById("hdField");
btnhd.value = $(lvrow).data("title") // in this part the program always stop
document.getElementById("getProj").click();
}
Thanks.
Upvotes: 1
Views: 37
Reputation: 19070
HTML DOM title Property:
var titleAttr = document.getElementById('myAbbr').title;
console.log(titleAttr);
<p>
<abbr id="myAbbr" title="World Health Organization">WHO</abbr> was founded in 1948.
</p>
In your function, once you get the element by id
, you can directly access to its property title
:
function getProj(lvrow) {
var btnhd = document.getElementById("hdField");
document.getElementById("getProj").click();
// Element's property title
console.log(btnhd.title);
}
Upvotes: 1
Reputation: 2713
as far as i understood, lvrow is your project object and it has title
property.
function getProj(lvrow){
var btnhd = document.getElementById("hdField");
btnhd.value = lvrow.title;
document.getElementById("getProj").click();
}
Hope this helps :)
Upvotes: 2