optikalefx Posted February 7, 2008 Share Posted February 7, 2008 Ive been looking around, and I really wanted a textarea that extends horizontally as you type only to the page width of course, and when you hit enter, the textarea extends vertically. Moreover, i wrote a script that takes the innerHTML of an element and places it in a textarea, how can i make the 'dynamic' textarea become the size of the text it inherited. here is an examle of an extending textarea that doesnt work in FF but does in safari. http://www.felgall.com/jstip45.htm here is my get page width var pageX = (document.all)?document.body.offsetWidth:window.innerWidth; and right now heres how im setting the width and heigh of the textarea style_w = (document.getElementById(cur_id))?document.getElementById(cur_id).offsetWidth:window.innerWidth; style_h = (document.getElementById(cur_id).style.offsetHeight); and then applying it to the textarea, element y y.style.width = style_w; y.style.height = style_h; thanks to anyone who can help me out! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.