Easy way to add drop down menu with 1 - 100 without doing 100 different options?

前端 未结 7 1526

I was just wondering if there was a simple shortcut to add options to a dropdown menu for the numbers 1 to 100 instead of having to do the following:

7条回答
  •  走了就别回头了
    2021-02-01 05:36

    As everyone else has said, there isn't one in html; however, you could use PUG/Jade. In fact I do this often.

    It would look something like this:

    select
      - var i = 1
      while i <= 100
        option=i++
    

    This would produce:

提交回复
热议问题