私はこのようなjsonオブジェクトを持っています
[
{ "id":"1", "item1":"item1 text","item2":"item2text","item3":"item3text" },
{ "id":"2", "item1":"item1 text","item2":"item2text","item3":"item3text" }
]
私の質問は、要素の ID を渡すことによって、関数を介して ID 2 を最初の位置に移動したいということです。お気に入り
function movetotop(id){
//Code here to move id 2 to the top position
}
誰かが助けてくれることを願っています。
よろしく