2017-05-07 105 views
1

我對HTML,CSS非常陌生,需要一些幫助。我試圖將我的清晰圖標放在所有瀏覽器的輸入標籤中。我使用了bootstrap glyphicon-remove類。下面是我的HTML標籤HTML,CSS(輸入內部跨度標記)

<input class="abc" type="text" maxlength="6"> 
<span class = " glyphicon glyphicon-remove " ng-show="showClearItem" ng-Click = "clearStuff()" ></span> 

我可以解決這個使用CSS,但是當我嘗試這與不同的瀏覽器,清除按鈕消失。

回答

0

好吧,這是MESS,完全混亂,在所有三個瀏覽器上工作。我試過很多的場景,但沒有工作對我來說,無論它們是單獨工作在Chrome和IE或火狐這裏的伎倆,我們來到了被稱爲jquery-search- plugin

這裏簡單的jQuery插件代碼段,其將所有的瀏覽器工作

$(function() { 
 
    // init plugin (with callback) 
 
    $('.clearable').clearSearch({ callback: function() { console.log("cleared"); } }); 
 

 
    // update value 
 
    $('.clearable').val('').change(); 
 
    
 
    // change width 
 
    $('.clearable').width('200px').change(); 
 
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://static1.kontaktkarte.de/js/jquery.clearsearch-1.0.4.js"></script> 
 
<input class="clearable" type="text" placeholder="search">

可以幫助你