2012-11-14 79 views
1

我有這樣的jQuery代碼:我需要改變什麼來將我的jQuery查找功能轉換爲mootools?

$('#uploadedFiles') // jQuery 
.find("input[value='"+searchedValue+"']").each(function(){ 
    window.alert($(this).attr("id")); 
}); 

這怎麼翻譯成MooTools的?

+0

未定義:某些別有用心的人的固定對我來說:)(即維持,而我是恢復從功能我嘗試翻譯的形式) – Octavian

+0

你可以添加'alert'函數嗎?因爲你也需要解決這個問題。 –

+0

@卡爾文:我對mootools沒有太多經驗。我試過尋找那些(他們有經常性的ID),但它看起來不是一個好的解決方案。 – Octavian

回答

5

假設uploadedFiles一些容器的標識:

$("uploadedFiles") // MooTools 
    .getElements("input[value='" + searchedValue + "']") 
    .each(function(el) { 
     window.alert(el.id); 
    }); 

DEMO:http://jsfiddle.net/e4Hbt/

相關問題