title: Select text / set focus in textInput
body: <p><strong>Background</strong></p>
  
  <p>In my app I have a login page with a <code>textInput</code> for the user name, a <code>passwordInput</code> for the password and an <code>actionButton</code> for submitting. If the password/username is not recognised, I show an error message. So far so good. I just want now to programatically select/highlight all the text in the username <code>textInput</code>, if the login did not work.</p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I select the text in the username input form? I looked at <code>updateTextInput</code> but with this I can only change the value, not the selection. Do I need to fall back to javascript?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>library(shiny)
  
  is_valid_user &lt;- function(uid, pwd) {
     FALSE
  }
  
  ui &lt;- fluidPage(
     textInput("uid", "Username:"),
     passwordInput("pwd", "Password"),
     actionButton("ok", "Login"),
     div(textOutput("error"))
  )
  
  server &lt;- function(input, output, session) {
      observeEvent(input$ok, {
                   if (!is_valid_user(req(input$uid), req(input$pwd))) {
                      output$error &lt;- renderText("Username/password incorrect!")
                      ## TODO: select all text in textInput("uid"), but HOW?
                   }})
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>