CSS: Create iOS style Pin Password box

后端 未结 6 2308
轮回少年
轮回少年 2021-02-14 03:19

I want to create a html5 input that looks like the iOS enter Pin (on the lock screen).... with 4 input boxes.

How do i achieve this?

6条回答
  •  逝去的感伤
    2021-02-14 04:03

    Instead of images, have 4 input boxes. Fiddle here: http://jsfiddle.net/JLyn9/2/

    
    
    
    
    
    moveOnMax =function (field, nextFieldID) {
        if (field.value.length == 1) {
            document.getElementById(nextFieldID).focus();
        }
    }
    

    PS the JS function can be optimized.

    EDIT/WARNING: This is not a solution to this problem. Please look at the other answers

提交回复
热议问题