jQuery picking out value but not showing/finding it within

时间:2017-10-23 20:47:36

标签: javascript jquery

I am trying to get the value of 79 out of the example below:

enter image description here

And I figured that would be pretty easy to get but it doesn't seem that way. I have tried the following to extract the 79:

console.log(width4);
console.log(width4["0"].clientWidth);
console.log($(width4).clientWidth);
console.log($(width4)[0].clientWidth);

Naturally the console.log(width4); shows me the tree that I have an image of above. I can see its there but for some reason this is the output of the above 4 console.log outputs:

>[td.jsgrid-cell.jsgrid-align-left]
jsgrid.js:511 0
jsgrid.js:512 undefined
jsgrid.js:513 0

enter image description here

So looking at that it seems that any of those I have used should at least see the value and not 0 or undefined?

2 个答案:

答案 0 :(得分:1)

听起来像是时间问题。也许你在它有机会呈现给DOM之前访问这些属性?

答案 1 :(得分:0)

看起来你没试过

timetable = int(input("Please enter a number: "))

那应该有用