简体   繁体   中英

Javascript: Get cell's column id

For example:

I want to accomplish what the following psuedo code does

<scipt>
var intCol = document.getElementById('x').column
</scipt>

Is there a way to do this?

Why can't you use cellIndex ?

On this page:

$('.postcell')[0].cellIndex
> 1
$('.votecell')[0].cellIndex
> 0

I know people hate W3Schools, but they do provide a good basic dataset: http://www.w3schools.com/jsref/prop_tabledata_cellindex.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM