There is a table. It is necessary to insert the Input box
, only to certain td
tags.
How to describe the condition?
$(function() { $('td').click(function(e) { //ловим элемент, по которому кликнули var t = e.target || e.srcElement; //получаем название тега var elm_name = t.tagName.toLowerCase(); //если это инпут - ничего не делаем if(elm_name == 'input') {return false;} var val = $(this).html(); var code = '<input type=text id=\"edit\" value='+val+' />'; $(this).empty().append(code); $('#edit').focus(); $('#edit').blur(function() { var val = $(this).val(); $(this).parent().empty().html(val); }); }); });
$(function() { $('td
Class_name').click(function(e)
- A_Chernitsov