How to display only the text in datalist HTML5 and not the value?

前端 未结 3 1399
后悔当初
后悔当初 2020-12-02 23:09

Here is an example:



    
3条回答
  •  半阙折子戏
    2020-12-02 23:39

    I though I would add a shorter Vanilla JS version of these answers. This will hide the true value, but when the item is submitted, it will replace it with your desired value on the form.

    
    
        
        
        
        
        
    
    ```
    
    
    
    

提交回复
热议问题