Is anyone out there proficient with HTML/CSS? I am completely stuck. I'm trying to create a text area that allows you to select all of the text simply by clicking it. The problem is that I have multiple text areas. So when you click any of the text areas, it only chooses all of the text from the first text area.



Here is the website: Lesson 10 - K5Lessons.com

Here is my code: [PHPNET]<script type="text/javascript">
function SelectAll(id)
{
document.getElementById(id).focus();
document.getElementById(id).select();
}
</script>

Title<br>
<textarea class="one" rows="5" id="txtarea" onClick="SelectAll('txtarea');" style="width:135px" >Insert Text Here[/PHPNET]



I also tried this code: <html>
[PHPNET]<head>
<script>
function displayResult()
{
document.getElementById("myTextarea").select();
}
</script>
</head>
<body>

<textarea id="myTextarea" cols="20">
At W3Schools you will find all the Web-building tutorials you need, from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
<br>

<button type="button" onclick="displayResult()">Select contents of text area</button>

</body>
</html>
[/PHPNET]