location.href=search.html?s=${this.value} //页面跳转
    回车跳转

    1. var input=document.getElementById("input");
    2. console.log(input.value);
    3. input.onkeydown=function(event){
    4. if(event.keyCode==13){
    5. location.href=`../2.html?id=${input.value}`
    6. }
    7. }

    //获取id的值
    var url = http://192.168.4.18:3000/search?keywords=${value}&type=10;
    //获取id值的地址
    var url=http://192.168.4.18:3000/album?id=${id}
    数字转换单位

    1. function redu(value) {
    2. var s=String(value);
    3. if (s.length>4) {
    4. return Math.floor(value/10000)+ "万";
    5. }
    6. return value;
    7. }