Select the entire html element or just its content

I bumped into this just a couple of minutes ago - Visual Studio’s one more ‘nifty’ feature that makes selecting the entire html element or just its content.

Alright, I’m in Visual Studio 2010 and I have the following HTML on my web page.

   1: <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
   2:     <table>
   3:         <tr>
   4:             <td>
   5:                 <asp:TextBox ID="NameTextBox" runat="server">Scott Gu</asp:TextBox>
   7:             </td>
   8:         </tr>
   9:     </table>
  10: </asp:Content>

Say I’m currently on the NameTextBox line and say you want to change the value (‘Scott Gu’ in this case). To have the entire value selected ‘instantly’, just look below and you’ll see something like:

image1

The ‘yellow’ box shows what html element you’re currently on. Now to select the value of the text, just hover over the yellow box and you’ll see a down-arrow with two options:

image2

There it is.. click on ‘Select Tag Content’ and you’ll see that the whole ‘Scott Gu’ has been selected. But I don’t think there’s another name that could replace ‘Scott Gu’, so let’s just leave it as it is! (Well, you at least now know how one more trick in VS).

You can also select the entire textbox element by clicking on the ‘Select Tag’ option from the dropdown. Going one step further, you can now select the entire column, row, the table or even the entire Content section by this mechanism.

I’ll be honest, I’ve seen this in 2008 as well, but me being a keyboard person mostly, I guess I never went ahead and checked this feature myself.

Verdict: Jeeyo (long live) Visual Studio!

No Comments