从工具提示中删除HTML元素。

huangapple go评论61阅读模式
英文:

Removing the HTML elements from the tooltip

问题

以下是您提供的HTML代码的翻译,其中已经删除了HTML标记:

<div class="row " id="record_block" style='margin-left:4px;margin-top:20px'>
    @foreach ($infomodel as $applicant)
    <div class="col-md-4 col-lg-4 col-xlg-4 mb-3">
        <div class="card card-body" style="background: #ebefff;">
            <div class="row">
                <div class="col-md-4 col-lg-3 text-center">
                    <a href="app-contact-detail.html">
                        <img src="storage/image/<?php echo $applicant['photo_filename'];?>" alt="user" style="width: 85px; height: 80px;" class="img-circle img-responsive">
                    </a>
                </div>
                <div class="col-md-8 col-lg-9">
                    <h5>
                        <span style="z-index: 0;">
                            <span data-toggle="tooltip" data-placement="top" data-original-title="" style="background: transparent; color: #0b719c; margin-left: 0px; z-index: 0;">
                                {{ Str::limit($applicant->last_name . ', ' . $applicant->first_name . ' ' . $applicant->middle_name, 17) }}
                                <i class="flag-icon flag-icon-af" title=""></i><br>
                                <i>Doctor of Medicine</i><br>
                            </span>
                            <span class='tooltip-content' style="display: none;">
                                <span style="margin-left: 15px;">
                                    <u><b>Fullname: {!! $applicant->last_name!!}, {!! $applicant->first_name!!} {!! $applicant->middle_name!!}</b></u><br/>
                                    Birthdate: {!! $applicant->birthdate !!}<br/>
                                    Country: {{ $applicant->country_name }}<br>
                                    Gender/CS: {!! $applicant->gender !!}/Single<br>
                                    Cellphone: <br>{!! $applicant?->country_code !!}{!! $applicant?->area_code !!}{!! $applicant?->tel_no !!}<br>
                                    Email:{{ $applicant?->email }}<br>
                                    Application ID:{!! $applicant?->app_id !!}<br>
                                    Date Last Updated: {!! $applicant->date_updated !!}
                                </span> 
                            </span>
                        </span>
                    </h5> 
                </div>
            </div>
            <div class="row">
                <div class="col-md-8 col-lg-12">
                    <address style="color: black; margin-left: 10px;">
                        <abbr title="Email Address">Email:</abbr> <b>{{ $applicant?->email }}</b><br>
                        <abbr title="Cellphone">Cellphone:</abbr> <b>{!! $applicant?->country_code !!}{!! $applicant?->area_code !!}{!! $applicant?->tel_no !!}</b><br>
                        <abbr title="Application ID">Application ID:</abbr> <b>#{!! $applicant?->app_id !!}</b><br>
                        <div style="height: 8px;"></div>
                        <button type="button" class="btn btn-rounded btn-outline-primary" style="position: relative; z-index: 0;" title="Click to Manage" onclick="location.replace('manage_applicant-set_sessionvars.php?lnk=fi&purpose=2&a=2716');">
                            <i class="fa fa-address-card-o"></i> Manage
                        </button>	
                    </address>
                </div>
            </div>
        </div>
    </div>
    @endforeach
</div>

请注意,我已经将HTML标签从文本中删除,只保留了文本内容。

英文:

How can i remove the html tags because whenever i hover my house to a specific part, the data will be displayed but the html tags were also included. maybe theres something that needs to be changed.

html snippet

&lt;div class=&quot;row &quot; id=&quot;record_block&quot; style=&#39;margin-left:4px;margin-top:20px&#39;&gt;
@foreach ($infomodel as $applicant)
&lt;div class=&quot;col-md-4 col-lg-4 col-xlg-4 mb-3&quot;&gt;
&lt;div class=&quot;card card-body&quot; style=&quot;background: #ebefff;&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-4 col-lg-3 text-center&quot;&gt;
&lt;a href=&quot;app-contact-detail.html&quot;&gt;
&lt;img src=&quot;storage/image/&lt;?php echo $applicant[&#39;photo_filename&#39;];?&gt;&quot; alt=&quot;user&quot; style=&quot;width: 85px; height: 80px;&quot; class=&quot;img-circle img-responsive&quot;&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-8 col-lg-9&quot;&gt;
&lt;h5&gt;
&lt;span style=&quot;z-index: 0;&quot;&gt;
&lt;span data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; data-original-title=&quot;&quot; style=&quot;background: transparent; color: #0b719c; margin-left: 0px; z-index: 0;&quot;&gt;
{{ Str::limit($applicant-&gt;last_name . &#39;, &#39; . $applicant-&gt;first_name . &#39; &#39; . $applicant-&gt;middle_name, 17) }}
&lt;i class=&quot;flag-icon flag-icon-af&quot; title=&quot;&quot;&gt;&lt;/i&gt;&lt;br&gt;
&lt;i&gt;Doctor of Medicine&lt;/i&gt;&lt;br&gt;
&lt;/span&gt;
&lt;span class=&#39;tooltip-content&#39; style=&quot;display: none;&quot;&gt;
&lt;span style=&quot;margin-left: 15px;&quot;&gt;
&lt;u&gt;&lt;b&gt;Fullname: {!! $applicant-&gt;last_name!!}, {!! $applicant-&gt;first_name!!} {!! $applicant-&gt;middle_name!!}&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;
Birthdate: {!! $applicant-&gt;birthdate !!}&lt;br/&gt;
Country: {{ $applicant-&gt;country_name }}&lt;br&gt;
Gender/CS: {!! $applicant-&gt;gender !!}/Single&lt;br&gt;
Cellphone: &lt;br&gt;{!! $applicant?-&gt;country_code !!}{!! $applicant?-&gt;area_code !!}{!! $applicant?-&gt;tel_no !!}&lt;br&gt;
Email:{{ $applicant?-&gt;email }}&lt;br&gt;
Application ID:{!! $applicant?-&gt;app_id !!}&lt;br&gt;
Date Last Updated: {!! $applicant-&gt;date_updated !!}
&lt;/span&gt; 
&lt;/span&gt;
&lt;/span&gt;
&lt;/h5&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-8 col-lg-12&quot;&gt;
&lt;address style=&quot;color: black; margin-left: 10px;&quot;&gt;
&lt;abbr title=&quot;Email Address&quot;&gt;Email:&lt;/abbr&gt; &lt;b&gt;{{ $applicant?-&gt;email }}&lt;/b&gt;&lt;br&gt;
&lt;abbr title=&quot;Cellphone&quot;&gt;Cellphone:&lt;/abbr&gt; &lt;b&gt;{!! $applicant?-&gt;country_code !!}{!! $applicant?-&gt;area_code !!}{!! $applicant?-&gt;tel_no !!}&lt;/b&gt;&lt;br&gt;
&lt;abbr title=&quot;Application ID&quot;&gt;Application ID:&lt;/abbr&gt; &lt;b&gt;#{!! $applicant?-&gt;app_id !!}&lt;/b&gt;&lt;br&gt;
&lt;div style=&quot;height: 8px;&quot;&gt;&lt;/div&gt;
&lt;button type=&quot;button&quot; class=&quot;btn btn-rounded btn-outline-primary&quot; style=&quot;position: relative; z-index: 0;&quot; title=&quot;Click to Manage&quot; onclick=&quot;location.replace(&#39;manage_applicant-set_sessionvars.php?lnk=fi&amp;purpose=2&amp;a=2716&#39;);&quot;&gt;&lt;i class=&quot;fa fa-address-card-o&quot;&gt;&lt;/i&gt; Manage&lt;/button&gt;	
&lt;/address&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
@endforeach
&lt;/div&gt;

screenshot
从工具提示中删除HTML元素。

答案1

得分: 4

将属性data-html=&quot;true&quot;添加到此span:

&lt;span data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; data-original-title=&quot;&quot; style=&quot;background: transparent; color: #0b719c; margin-left: 0px; z-index: 0;&quot; data-html=&quot;true&quot;&gt;

根据文档,它允许在工具提示中使用HTML。

英文:

Add the attribute data-html=&quot;true&quot; to this span :

&lt;span data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; data-original-title=&quot;&quot; style=&quot;background: transparent; color: #0b719c; margin-left: 0px; z-index: 0;&quot;&gt;

As per the documentation, it allows HTML in the tooltip.

huangapple
  • 本文由 发表于 2023年2月16日 16:48:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75469752.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定