在html中,比如<a href=""><p>INPUT</p></a>中的INPUT由用户text框输入,这个怎么实现?

解决方案 »

  1.   

    用input 或 textarea吧,样式可以改变。
    p没有这功能
      

  2.   

    把用户输入的交给js处理,之后用documentwrite("<p>"+****+"</P");(*****的是保存用户提交信息的变量)
    楼主可以查一下js的 获取表单数据之类的信息。
      

  3.   

    p尽量不要放在a里面 
    我用jquery实现的 不知道 能不能帮到你
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                $("button").click(function () {
                    var word = $("input").val();
                    $("p").text(word);
                })
            })
        </script>
    </head>
    <body>
           <a href=""></a> <p style="width:50px; height:30px; background-color:Yellow;"></p>
           <input type="text" />
           <button>button</button>
    </body>
    </html>
      

  4.   

    <script>  
     function change(){
    var a=document.getElementById("test").value;
    document.getElementById("test").style.display="none";
    document.links[0].innerText=a;
    }
    </script>   </head><body>
    <a href=""><input type="text" id="test" onblur="change()" style="display:block;"></a>
    </body>
    这样试试  我在ie下试试可以
      

  5.   

    把innerText改成innerHTML也可以  直接输入<font color=red>a</font>还能直接指定超链接字显示的颜色了   呵呵
      

  6.   

    这样就可以了:
    <input id='input1' type="text"/><input type="button" value="确定" onclick="docment.getElementById('outp').innerHTML=this.value;" />
    <p id='outP'></p>
      

  7.   

    前面写错了,修改下,这样就可以了:
    <input id='input1' type="text"/><input type="button" value="确定" onclick="docment.getElementById('outp').innerHTML=docment.getElementById('input1').innerHTML;" />
    <p id='outP'></p> 
      

  8.   


    <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    <script>
    function doChange(){
    p1.innerHTML=text1.value;
    }
    </script>
    <body>
    <a href=""><p id="p1">INPUT</p></a>
    <input type="text" id="text1" name="text1" onchange="doChange();"/>
    </body>
    </html>