DizzyDan Posted June 7, 2012 Share Posted June 7, 2012 Putting the code in <textarea></textarea> work great but the text can be deleted. How can I make it so the code can't be deleted in the <textarea>? Also is there an easy way to make a button or link when clicked automatically copy what is in the <textarea>? Thanks! Link to comment Share on other sites More sharing options...
eTianbun Posted June 7, 2012 Share Posted June 7, 2012 readonly="readonly" Link to comment Share on other sites More sharing options...
Ingolme Posted June 7, 2012 Share Posted June 7, 2012 If you substitute the angle brackets for < and > you can print HTML code inside any element, not just a textarea. Link to comment Share on other sites More sharing options...
DizzyDan Posted June 7, 2012 Author Share Posted June 7, 2012 Readonly PERFECTO! thats the term I was looking for. I did the textarea because its easy to 'select all' for 'copy and pasting' the code. But I'm also looking for a way where a user can click a link or button and it will copy what is in the textarea to their clipboard. Link to comment Share on other sites More sharing options...
eTianbun Posted June 7, 2012 Share Posted June 7, 2012 ...I'm also looking for a way where a user can click a link or button and it will copy what is in the textarea to their clipboard. Why do you want this? Is Ctrl+C too difficult to press? Link to comment Share on other sites More sharing options...
DizzyDan Posted June 7, 2012 Author Share Posted June 7, 2012 No I hear ya it's not like i have a problem but it would be nifty to have it done for you. I suppose it more of a scripting thing I can deal without it though.Thanks for the lightning fast responses! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now