closest

    1熱度

    1回答

    http://jsfiddle.net/twkRY/ <table> <tr> <td class="iwant">ttt</td> <td>some text <span class="txt">haha</span></td> </tr> </table> $(".txt").on("click", function() { aler

    0熱度

    1回答

    我有一個與table行這樣一個可變的量選擇不同類型的細胞內輸入: <tr class"hotel-room"> <td class="cell1"> <input type="hidden" class="hotel-id" name="input_01[label][row][progressive][id]" value="5893" /> <input t

    0熱度

    5回答

    我想獲得textarea的值(class =「caption_textarea」),當點擊類「save_caption」的鏈接時。 textarea的值是用ajax改變的,我在這裏不包括它,因此它不總是空的。 我有以下HTML代碼: <div class="caption_text" style="display:none;"> <div class="small_icons">

    3熱度

    5回答

    我已經坐了一段時間,試圖解決一個問題,我敢肯定很簡單,但它不能讓它工作。 我得到這個HTML: <div class="span4"> <div id="content" class="col-1"></div> <div class="add"> <div class="dropdown btn-group"> <a class="btn dropdow

    2熱度

    2回答

    我有我的應用程序SQLite數據庫中查找最接近的值,它是設置這樣的: id Value1 Value2 1 12.51 10 2 14.62 20 3 18.94 30 4 21.07 40 我想有一個代碼,就爲數值1列搜索與輸入 的最接近的值,並返回Value2列中同一行的值。 實施例: 我有一個變量x = 15.12,代碼應該搜索有關值1(14.62)最接近的值,並從值2返回各自的

    12熱度

    2回答

    我試圖做使一些文字顯示在文本輸入是重點,但最近的();方法似乎沒有工作。 我已經做了JS Fiddle給你看。 這裏是代碼也。 JS $(document).ready(function(){ $('.validation-error').hide(); $('.name-input').on("focus", function(){ $(this).closest(

    1熱度

    2回答

    爲什麼我不能在下面的例子中觸發提交按鈕的最接近的形式? HTML, <form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user"> <input type="submit" value="Submit"> </form> jQuery的, $(

    1熱度

    2回答

    我想將「文本完整」移動到h3.title部分。當我使用下面的Jscript時,「文本完整」移動到div.caption的開頭。該元素在頁面上重複多次,並且需要特定於最接近的匹配。 <div class="caption">... <div class="date">...</div> <h3 class="title">"text complete" should go here</h3>

    0熱度

    2回答

    'Kay對可能會成爲一個簡單問題以及我的hacky代碼表示歉意:P但是我一直在絞盡腦汁,幾個小時查看文檔,我圍繞着圈子,我的代碼基本上是功能性的,但我沒有從rec-outlay標籤中選擇文本值,我無法弄清楚爲什麼。 繼承人是例如我的HTML: <div class='item'> <p class='issue-title'><strong>Lorem Ipsum</strong></p> <

    0熱度

    2回答

    事情是我在每個元素中都有一個類似Facebook的按鈕(使用API​​創建而不是常規元素),並且需要在添加類之前檢查其狀態「或」unliked「。因此,所有具有類「item」的div都是在PHP循環中創建的。而且我也明白,在循環中多次運行腳本並不好。但我需要進一步在這裏的測試:) <div class="item"> <span class="status"> <div cla