对立色彩空间_输入对立点:HTML5输出元素

对立色彩空间

Of the many new features introduced by HTML5, only one element was designed to be the exact opposite of a tag that already existed: <output>, the logical companion to HTML’s <input>.

HTML5引入的许多新功能中,只有一个元素被设计为与已经存在的标签完全相反: <output> ,HTML的<input>的逻辑伴侣。

Originally designed to contain the results of a form calculation, the scope of the <output> element was expanded to make it useful for many purposes, not just traditional forms. However, like <progress> and other tags, <output> depends on HTML5’s close relationship with JavaScript: without the addition of some simple scripting, the tag doesn’t have a great deal of utility.

最初旨在包含表单计算结果的元素,后来扩展了<output>元素的范围,使其可用于多种用途,而不仅仅是传统表单。 但是,像<progress>和其他标签一样, <output>取决于HTML5与JavaScript的紧密关系:如果不添加一些简单的脚本,该标签就没有太多实用程序。

To demonstrate the <output> element, let’s say that we want to create an online purchasing system for concert tickets in North America, with a cover price of $25 per head. All purchases will be limited to 12 tickets. The basic markup for the form would be:

为了演示<output>元素,假设我们要创建一个北美演唱会门票在线购买系统,每人的标价为25美元。 所有购买将仅限于12张票。 表单的基本标记为:

<form>
	<label for="ticketcount">Number of passes</label>
	<input type="number" name="ticketcount" id="ticketcount" min="1" max="12" value="1" onchange="spinny()">
	<span id="price">@ $25 per ticket</span> =
	<output name="total" for="ticketcount price">$25</output>
</form>

Note that the <output> element contains default content, and that practices are followed, with the addition that the for attribute of the output takes all the space-delimited id values of the elements that contribute to its final value.

请注意, <output>元素包含默认内容,并遵循做法,另外, outputfor属性采用所有以空格分隔的id值,这些id值构成其最终值。

To update the total cost of ticket purchases, we can use a little JavaScript:

要更新购票的总费用,我们可以使用一些JavaScript

var total = document.querySelector('output[name="total"]'),
ticketcount = document.getElementById('ticketcount');
function spinny() {
	total.value = "$" + ticketcount.valueAsNumber * 25;
}

The result:

结果:

@ $25 per ticket = @每张票$ 25 = $25 $ 25

Internet Explorer has a problem with updating output using the value method; innerHTML is more reliable cross-browser.

Internet Explorer在使用value方法更新output遇到问题; innerHTML是更可靠的跨浏览器。

The <output> element can also be used to display the value of a form input that otherwise lacks presentation, such as range.

<output>元素还可用于显示否则缺少表示形式的表单输入的值,例如range

<form oninput="weight.value =  shippingweight.valueAsNumber.toPrecision(3)">
	<label for="shippingweight">Shipping Weight</label>
	<input type="range" min="0" max="25" value="1.0" step="0.1" name="shippingweight" id="shippingweight">
	<output name="weight" for="shippingweight">1.0</output>kg
</form>

The result:

结果:

1.0kg 1.0公斤

In a broader sense, the <output> element can be used to show the outcome of a user action: for example, the reported results of a form submission.  <output> is extremely versatile and easy to style: you can use any CSS on it that can be applied to any other element. Best of all, it has support in all modern browsers: there's no need for any polyfills.

从广义上讲, <output>元素可用于显示用户操作的结果:例如,表单提交的报告结果。 <output>用途广泛且易于设置样式:您可以在其上使用可以应用于任何其他元素的任何CSS 。 最好的是,它在所有现代浏览器中都具有支持:不需要任何polyfill。

翻译自: https://thenewcode.com/754/input-Antipode-The-HTML5-output-Element

对立色彩空间

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
、恐怖主义等等,这些问题都是矛盾和对立的集中表现。矛盾论可以帮这段代码定义了一个`biLSTM_layer`函数,用于实现双向LSTM层的计算。 在函数内部,首先进入一个名为`BiLSTM`的变量作用域。然后,定义了一个空助我们更好地理解和解决这些问题。例如,在应对全球气候变化的过程中,字典`lstm_cell`,用于存储前向和后向LSTM的状态。 接着,使用`for`我们需要深入分析各种矛盾和对立面,充分发挥矛盾的动力和源泉,推循环分别对前向和后向LSTM进行定义。对于每个方向,定义了一个`CoupledInputForgetGateLSTMCell`类型的LSTM单元,用于计算LSTM的输出和状态。其中,`use_pe动各国之间的合作和协调,共同应对这一全球性挑战。 总之,矛盾epholes`参数表示是否使用窥视孔连接,`initializer`参数表示权重初始化方式,`state_is_tuple`参数表示论是中国马克思主义哲学的重要理论创新,它的提出和发展对于中国和LSTM的状态是否作为一个元组返回。 接下来,使用`tf.nn.bidirectional_dynamic_rnn`函数,实现双向LSTM的计算。该函数接受前向和后向LSTM单元、输入数据、数据类型、以世界的哲学和社会科学都具有重要意义。在当代,矛盾论仍然具有及序列长度等参数,返回LSTM层的输出和状态。 最后,使用`tf.concat`函数将前向和后向LSTM的输出连接起来,返回一个形状为`[batch_size, num_steps, 2*lstm_dim]深刻的理论意义和现实价值,它可以为我们提供更加深刻的思考工具,`的张量,其中`batch_size`表示批量大小,`num_steps`表示序列长度,`lstm_dim`表示LSTM的维度。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值