展开折叠html字段Firefox [英] expand collapse html field Firefox

查看:94
本文介绍了展开折叠html字段Firefox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Firefox中展开/折叠html字段?我从网上收集了一些JavaScript的例子,但他们只在IE中工作。 (我仅限于HTML和JS)



建议表示赞赏。



谢谢。

是的,我想显示/隐藏div等。如果你的输入字段有一个ID属性,你可以使用CSS来根据需要来设置它的样式。我推荐使用像jQuery这样的库,但是我提供了一个没有如此的例子:

  //不使用jQuery隐藏
document.getElementById('myInput')。style.display ='none'
//显示没有jQuery
document.getElementById('myInput')。style.display ='block'

//隐藏jQuery $ b $('#myInput')。hide()
//显示jQuery
$('#myInput')。show()

jQuery: http ://jquery.com


How do I expand/collapse an html field in Firefox? I incorporated a few JavaScript examples from the web, but they only worked in IE. (I'm limited to HTML and JS)

Suggestions are appreciated.

Thanks.

Yes, I would like to show/hide divs and such.

解决方案

If your input field has an ID attribute, you can use CSS to style it as needed. I recommend using a library like jQuery, but I have provided an example without as well:

  // hiding without jQuery
  document.getElementById('myInput').style.display = 'none'
  // showing without jQuery
  document.getElementById('myInput').style.display = 'block'

  // hiding with jQuery
  $('#myInput').hide()
  // showing with jQuery
  $('#myInput').show()

jQuery: http://jquery.com

这篇关于展开折叠html字段Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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