当我单击跨度值时,它使用Javascript传递文本框 [英] When I Click Span Values ,It Passes Text Box Using Javascript

查看:54
本文介绍了当我单击跨度值时,它使用Javascript传递文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击跨度值时,它会使用javascript传递文本框

当我点击任何范围时,要在一个模态弹出窗口中显示所有值。但是在该模态弹出窗口中特定点击的跨度值要更改文本框值value.how是否可以









HTML标签;



when i click span values ,it passes text box using javascript
WHEN i click any span,TO show those all values in one modal popup.But in that modal popup particular clicked span value to change text box value.how is it possible




HTML TAG;

<span class='txtToInput'>0.5</span>
<span class='txtToInput'>0.8</span>
<span class='txtToInput'>0.8</span>
<span class='txtToInput'>0.8</span>
<span class='txtToInput'>0.8</span>







javascript








javascript


$(function () {
$('.txtToInput').live('click', function () {
    var input = $('<input />', {'type': 'text','class': 'txtToInput', 'name': 'aname', 'value': $(this).html()});
    $(this).parent().append(input);
    $(this).remove();
    input.focus();
});

$('.txtToInput').live('blur', function () {
    var span = $('<span />', {'class': 'txtToInput'});
    $(this).parent().append($(span).html($(this).val()));
    $(this).remove();
});
});

推荐答案

(function(){
(function () {


('。 txtToInput')。live('click',function(){
var input =
('.txtToInput').live('click', function () { var input =


('< 输入 / > ',{'type':'text','class':'txtToInput','name':'aname','value':
('<input />', {'type': 'text','class': 'txtToInput', 'name': 'aname', 'value':


这篇关于当我单击跨度值时,它使用Javascript传递文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆