[英]how to get the title attributes in my lvrow in javascript
im trying to get the title in function getProj(lvrow)
. 我试图在
function getProj(lvrow)
获得标题。 but i dont know whats wrong in my javascript. 但我不知道我的JavaScript中有什么不对。
heres my javascript 继承人我的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. 谢谢。
as far as i understood, lvrow is your project object and it has title
property. 据我所知 , lvrow是你的项目对象,它有
title
属性。
function getProj(lvrow){
var btnhd = document.getElementById("hdField");
btnhd.value = lvrow.title;
document.getElementById("getProj").click();
}
Hope this helps :) 希望这可以帮助 :)
HTML DOM title Property: HTML DOM标题属性:
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
: 在您的函数中,一旦您通过
id
获取元素,您就可以直接访问其属性title
:
function getProj(lvrow) {
var btnhd = document.getElementById("hdField");
document.getElementById("getProj").click();
// Element's property title
console.log(btnhd.title);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.