خرید بک لینک

Vote count: 0

I am working on a project and I am having problem on finding element id based on the custom attributes (data-index). Plz someone help me...

HTML CODE:

<div id="2" data-index="1" style="width: 500px; left: -500px; transition-duration: 0ms; transform: translate(500px, 0px) translateZ(0px);"><b>May your birthday and every day be filled with the warmth of sunshine, the happiness of smiles, the sounds of laughter, the feeling of love and the sharing of good cheer.</b></div>

JS Function:

function saveLike(){
var currentPostion = mySwipe.getPos();
var cars = $("div").find("[data-index='" + currentPostion + "']").id;
str = JSON.stringify(cars);
console.log(str);
alert(str);

}

asked 44 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 14 خرداد 1395 ساعت: 11:47

صفحه بندی