下面的代碼是從我的數據庫創建的,因此它的多個與classes
名稱相同,但內容不同。 我需要做的是,當點擊按鈕class = 'config'
被點擊時,我需要this
div值this
class = config
。 我將如何繼續這個?如何從元素中獲取元素值
$(".config").click(function(){
var id = $(this).attr('id');
});
任何提示?
HTML
<div class="mws-form-row bordered">
<label class="mws-form-label"><?php echo SaleAdmin_Engine::getConfigName($this->result[0]['config_name']) ; ?></label>
<div class="mws-form-item">
<b>Value</b> <input type="text" class="value required large" value="<?php echo $this->result[0]['config_value']; ?>">
<b>Type</b> <input type="text" class="type required large" value="<?php echo $this->result[0]['config_type']; ?>">
<b>Info</b> <textarea rows="" cols="" class="info required large"><?php echo $this->result[0]['config_info']; ?></textarea>
</div>
<button class="config btn btn-inverse btn-small" rel="<?php echo $this->result[0]['config_id']; ?>" type="button">Save</button>
</div>
你的意思是你想要做什麼,但你不能告訴其中的代碼的問題是堅持? – akash4eva 2013-05-07 15:35:37