我正在尝试使用<a href>
内的innerHTML
标记添加特定于通话的电话号码。我试过双引号和单引号。
第一个案例 根本没有解雇。
确实出现了第二案例 ,但是当点击电话号码而不是拨号时,它会关闭。
var popDiv = document.createElement('span');
popDiv.setAttribute('class', 'popDiv');
popDiv.innerHTML ="It seems you are looking for: " + "<span style='color:#FF0000'>" + getTitle + "</span>" + "<br />" + "Why don't you call me?" + "<a href='tel:01234567890'>01234 567 890</a>";
请找到JSFiddle
的链接有谁知道可能的解决方案是什么?
答案 0 :(得分:1)
您需要查看EditText rb = new EditText(this);
// Field ID list is a hashmap of unique integer IDs with string keys
rb.setId(fieldIDList.get("byField"));
linearLayout.addView(rb);
// This is a test variable that confirms the ID has been set in debugging
int testVar = rb.getId();
事件的mouseup
以及target
,然后才能删除h1
。这应该有效:
popDiv
更新了 jsFiddle
答案 1 :(得分:0)
试试吧:
var popDiv = document.createElement('span');
popDiv.setAttribute('class', 'popDiv');
popDiv.innerHTML ="It seems you are looking for: " + "<span style='color:#FF0000'>" + getTitle + "</span>" + "<br />" + "Why don't you call me?" + "<a href=\"tel:01234567890\">01234 567 890</a>";
并确保你没有这样的元:
<meta name = "format-detection" content = "telephone=no">