Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:53:34+00:00 2026-06-04T19:53:34+00:00

Lets suppose that I have simple html markup: <div> <input type=text/> </div> when I

  • 0

Lets suppose that I have simple html markup:

<div>
    <input type="text"/>
</div>

when I click on div I would like to focus input. What ways of doing this i have?

I was thinking about several possibilities, but non looked good:

  • just forget about knockout and use good old jQuery. But then code turns into spaghetti and UI behavior is spread across many places.
  • create custom bindingHandler for input and add click binding to div, clicking changes some model property, custom binding reacts on it and raises focus event. But this looks too complicated for such easy thing (at least in jq it was easy).

Is there other options?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:53:36+00:00Added an answer on June 4, 2026 at 7:53 pm

    Knockout is great for building a UI with a backing data model. This doesn’t help when you need to do low-level DOM manipulation (like you’re describing). In fact, on the introduction page for knockout, the author states:

    Everyone loves jQuery! It’s an outstanding replacement for the clunky,
    inconsistent DOM API we had to put up with in the past. jQuery is an
    excellent low-level way to manipulate elements and event handlers in a
    web page. I certainly still use jQuery for low-level DOM manipulation.
    KO solves a different problem.

    (emphasis mine)

    Personally I would think it’s fine to use jQuery for this type of manipulation. If you break your event handlers and MVVM code into separate JavaScript files, you can avoid writing spaghetti code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets suppose that I have the following simple query var q = from p
Suppose I have a simple MySQL table that looks like this: CREATE TABLE `my_table`
Lets suppose that I have some pages some.web/articles/details/5 some.web/users/info/bob some.web/foo/bar/7 that can call a
Lets suppose that I have a Category table with a column that holds the
Suppose I have 2 cells that are merged, lets say Sheet1!$A$1:$B$1 . And lets
I have a simple little dialog that lets user setup a time block. The
I got a simple question here Let's suppose we have a codebase that employs
I have a very simple question. Lets suppose there is C# project name Game
Suppose you have a simple block of code like this: app.get('/', function(req, res){ res.send('Hello
Let's suppose that I have 2 processes in Erlang, and each process has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.