English 中文(简体)
• 如何在文字领域召集模拟活动
原标题:How to call mouse events in text field

我想集中谈谈案文领域。 如何做到这一点? 现在,我的法典照此办理。

  <div class= label_input >
    <%= f.label :username %>
    <%= f.text_field :username %>
    <div class= clearfix ></div>
  </div>

Expecting similar to the HTML code

<input type="text" onmouseover="this.focus()"></input>
最佳回答

可通过onmouseovertext_field(docs

问题回答

有时,我只是ski手脚,写上了html。

你可以尝试:

<div class= label_input >
    <%= f.label :username %>
    <input id="user_name" name="user[name]" size="30" type="text" onmouseover="this.focus()"></input>
    <div class= clearfix ></div>
  </div>

我认为,在某些情况下,铁路公司认为帮助者比html更加麻烦。 因此,使用最容易的东西。

如果你更新带有javascript的箱子,这种做法确实是有益的。

<div class= label_input >
  <%= f.label :username %>
  <%= f.text_field :username, onmouseover: "this.focus()" %>
  <div class= clearfix ></div>
</div>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签