操作中的哈希值是什么意思 = HTML 表单标记中的"#"



在html表单标签中action="#"是什么意思?例如,

<form action="#" method="post" class="demoForm" id="demoForm">
    <fieldset>
        <legend>Demo: Checkboxes Sharing Same Name</legend>
    <p>Check the types of sports or fitness activities you engage in on a regular basis.</p>
    <p>
        <label><input type="checkbox" name="sports[]" value="cycling" /> cycling</label>
        <label><input type="checkbox" name="sports[]" value="running" /> running</label>
        <label><input type="checkbox" name="sports[]" value="other" /> other</label>
    </p>
    </fieldset>
</form>

'#'向自己提交表单操作url(表单所在的页面url)。主要用于虚拟目的和相同的页面表单提交,尽管有更好的技术。看看这个答案

form action attribute是什么意思

#表示不进行外部重定向。换句话说,没有链接到另一个单独的页面。如果需要引用,则只能在该页内引用。

<form>标签:<form action="#">意味着当点击表单的提交按钮时,不必将收集的数据重定向到任何其他页面。

<a>标签:<a href="#">意味着当点击链接时,不要重定向到任何页面。保持在同一页。

在web开发中(在HTML中)"#"表示没有链接。:)

最新更新