How can I refresh rows by click button

What I need:

  1. input a text
  2. click the search button
  3. show all the videos that click funtion returned, the quantity of return videos is not fixed, each three of those show as a row.
    now I can do 1 and 2, but how to get 3?